Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(chat): show errors if there are issues when getting databases & collections to pick VSCODE-610 #864

Merged
merged 42 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ff0c1cc
WIP
gagik Oct 31, 2024
f9dd536
Move around dependencies
gagik Nov 1, 2024
09c7414
Remove grep
gagik Nov 1, 2024
aada8e1
Use firstCall
gagik Nov 1, 2024
eb2c7dc
Add test filtering
gagik Nov 1, 2024
bcd260b
Update CONTRIBUTING.md
gagik Nov 1, 2024
a9beef1
Escape the environment variable
gagik Nov 1, 2024
2e4bd70
Merge branch 'gagik/add-test-filtering' of github.com:mongodb-js/vsco…
gagik Nov 1, 2024
33c995e
Fix wording
gagik Nov 1, 2024
8582193
Add schema tests
gagik Nov 1, 2024
a8bc30d
align tests and use a stub
gagik Nov 1, 2024
5ddc7fb
Add saving to metadata
gagik Nov 1, 2024
06435e8
Move things
gagik Nov 3, 2024
5a58171
Better org
gagik Nov 3, 2024
fdbabfc
Merge branch 'gagik/add-test-filtering' of github.com:mongodb-js/vsco…
gagik Nov 3, 2024
f23e19f
simplify tests and picking logic
gagik Nov 3, 2024
274fe17
typos
gagik Nov 3, 2024
54885d6
Align with broken test
gagik Nov 4, 2024
cfb9d61
Add error info and tests
gagik Nov 4, 2024
f080016
wrap l10n
gagik Nov 4, 2024
190f4f6
Merge branch 'gagik/one-no-collection-handling' of github.com:mongodb…
gagik Nov 5, 2024
182dc15
wrap in l10n
gagik Nov 5, 2024
a341e45
remove settings change
gagik Nov 5, 2024
c1b6534
Merge branch 'main' of github.com:mongodb-js/vscode into gagik/no-dat…
gagik Nov 5, 2024
378b202
Merge branch 'main' of github.com:mongodb-js/vscode into gagik/one-no…
gagik Nov 5, 2024
62c07ef
Apply suggestions from code review
gagik Nov 6, 2024
f2b54ea
changes from review
gagik Nov 6, 2024
bf2a0c7
switch to parametrized tests
gagik Nov 6, 2024
02f45dc
Merge branch 'gagik/one-no-collection-handling' into gagik/no-databas…
gagik Nov 6, 2024
a1765ef
remove patched vscode
gagik Nov 6, 2024
ccacb8a
remove vscode
gagik Nov 6, 2024
886aa45
better comments
gagik Nov 6, 2024
52dbdf6
fix potential CI discrepancy
gagik Nov 7, 2024
686c7cd
Merge branch 'main' of github.com:mongodb-js/vscode into gagik/one-no…
gagik Nov 7, 2024
fee668e
combine message text
gagik Nov 7, 2024
e1d12bf
add explicit undefined returns
gagik Nov 7, 2024
c92cdcb
Merge branch 'gagik/one-no-collection-handling' into gagik/no-databas…
gagik Nov 7, 2024
985ed49
Move tests to parameterized
gagik Nov 7, 2024
853eccf
Merge branch 'main' of github.com:mongodb-js/vscode into gagik/no-dat…
gagik Nov 8, 2024
0162400
propagate the error
gagik Nov 8, 2024
378179c
fix test and error instead of markdown
gagik Nov 8, 2024
ec67467
use l10tn in errors
gagik Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,20 @@
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite"
],
"env": {
"MOCHA_GREP": "${input:mochaGrep}"
},
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "npm: compile:extension",
}
],
"inputs": [
{
"id": "mochaGrep",
"type": "promptString",
"description": "Enter an optional grep filter to run specific tests. Leave blank for all.",
}
],
"compounds": [
{
"name": "Extension + Server Inspector",
Expand Down
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ npm run watch

2. Inside of [VS Code Insiders](https://code.visualstudio.com/insiders/) open this directory and press `F5` to begin debugging the extension. This should launch a new VSCode window which is running the extension.

### Running Tests

#### Using the VSCode debugger

You can launch a debugging task for tests inside VSCode with the **"Run Tests"** task. There you can also specify an optional test filter.

#### Using command line

You can run tests using command line along with an optional `MOCHA_GREP` environment variable to apply a grep filter on tests to run.

```shell
MOCHA_GREP="Participant .* prompt builders" npm test
```

It may be quicker to be more specific and use `npm run test-extension` or `npm run test-webview` after compiling.

### Using Proposed API

The vscode extension will occasionally need to use [proposed API](https://code.visualstudio.com/api/advanced-topics/using-proposed-api) that haven't been promoted to stable yet. To enable an API proposal, add it to the `enabledApiProposals` section in `package.json`, then run `cd src/vscode-dts && npx @vscode/dts dev` to install the type definitions for the API you want to enable.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"pretest": "npm run compile",
"test": "npm run test-webview && npm run test-extension",
"test-extension": "cross-env NODE_OPTIONS=--no-force-async-hooks-checks xvfb-maybe node ./out/test/runTest.js",
"test-webview": "mocha -r ts-node/register --file ./src/test/setup-webview.ts src/test/suite/views/webview-app/**/*.test.tsx",
"ai-accuracy-tests": "env TS_NODE_FILES=true mocha -r ts-node/register --file ./src/test/ai-accuracy-tests/test-setup.ts ./src/test/ai-accuracy-tests/ai-accuracy-tests.ts",
"test-webview": "mocha -r ts-node/register --grep=\"${MOCHA_GREP}\" --file ./src/test/setup-webview.ts src/test/suite/views/webview-app/**/*.test.tsx",
"ai-accuracy-tests": "env TS_NODE_FILES=true mocha -r ts-node/register --grep=\"${MOCHA_GREP}\" --file ./src/test/ai-accuracy-tests/test-setup.ts ./src/test/ai-accuracy-tests/ai-accuracy-tests.ts",
"analyze-bundle": "webpack --mode production --analyze",
"vscode:prepublish": "npm run clean && npm run compile:constants && npm run compile:resources && webpack --mode production",
"check": "npm run lint && npm run depcheck",
Expand Down
Loading
Loading