Skip to content

Commit 642b8e5

Browse files
committed
Add documentation for new test suite and scripts
1 parent 6b8467f commit 642b8e5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@ We have several types of tests:
9898
* Unit tests: these live in the `tests/unit-tests/` directory
9999
* View tests: these live in `src/view/variant-analysis/__tests__/`
100100
* VSCode integration tests:
101-
* `test/vscode-tests/no-workspace` tests: These are intended to cover functionality that is meant to work before you even have a workspace open.
101+
* `test/vscode-tests/activated-extension` tests: These are intended to cover functionality that require the full extension to be activated but don't require the CLI. This suite is not run against multiple versions of the CLI in CI.
102+
* `test/vscode-tests/no-workspace` tests: These are intended to cover functionality that is meant to work before you even have a workspace open but don't require the extension to be activated.
102103
* `test/vscode-tests/minimal-workspace` tests: These are intended to cover functionality that need a workspace but don't require the full extension to be activated.
103104
* CLI integration tests: these live in `test/vscode-tests/cli-integration`
104-
* These tests are intendended to be cover functionality that is related to the integration between the CodeQL CLI and the extension.
105+
* These tests are intended to be cover functionality that is related to the integration between the CodeQL CLI and the extension. These tests are run against all supported versions of the CLI in CI.
105106

106107
The CLI integration tests require an instance of the CodeQL CLI to run so they will require some extra setup steps. When adding new tests to our test suite, please be mindful of whether they need to be in the cli-integration folder. If the tests don't depend on the CLI, they are better suited to being a VSCode integration test.
107108

@@ -119,7 +120,7 @@ Then, from the `extensions/ql-vscode` directory, use the appropriate command to
119120

120121
* Unit tests: `npm run test:unit`
121122
* View Tests: `npm test:view`
122-
* VSCode integration tests: `npm run integration`
123+
* VSCode integration tests: `npm run test:vscode-integration`
123124

124125
###### CLI integration tests
125126

@@ -130,7 +131,7 @@ The CLI integration tests require the CodeQL standard libraries in order to run
130131
2. Run your test command:
131132

132133
```shell
133-
cd extensions/ql-vscode && npm run cli-integration
134+
cd extensions/ql-vscode && npm run test:cli-integration
134135
```
135136

136137
##### 2. From VSCode
@@ -161,13 +162,13 @@ The easiest way to run a single test is to change the `it` of the test to `it.on
161162
to only run tests for this specific file. For example, to run the test `test/vscode-tests/cli-integration/run-queries.test.ts`:
162163

163164
```shell
164-
npm run cli-integration -- --runTestsByPath test/vscode-tests/cli-integration/run-queries.test.ts
165+
npm run test:cli-integration -- --runTestsByPath test/vscode-tests/cli-integration/run-queries.test.ts
165166
```
166167

167168
You can also use the `--testNamePattern` option to run a specific test within a file. For example, to run the test `test/vscode-tests/cli-integration/run-queries.test.ts`:
168169

169170
```shell
170-
npm run cli-integration -- --runTestsByPath test/vscode-tests/cli-integration/run-queries.test.ts --testNamePattern "should create a QueryEvaluationInfo"
171+
npm run test:cli-integration -- --runTestsByPath test/vscode-tests/cli-integration/run-queries.test.ts --testNamePattern "should create a QueryEvaluationInfo"
171172
```
172173

173174
##### 2. From VSCode

0 commit comments

Comments
 (0)