Skip to content

Commit 588351b

Browse files
committed
Merge remote-tracking branch 'origin/main' into koesie10/sort-repositories
2 parents 5ff7b8a + c0ba9c5 commit 588351b

35 files changed

+1465
-2543
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
**/* @github/codeql-vscode-reviewers
22
**/remote-queries/ @github/code-scanning-secexp-reviewers
33
**/variant-analysis/ @github/code-scanning-secexp-reviewers
4+
**/databases/ @github/code-scanning-secexp-reviewers

CONTRIBUTING.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,17 @@ We have several types of tests:
102102

103103
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.
104104

105+
Any test data you're using (sample projects, config files, etc.) must go in a `src/vscode-tests/*/data` directory. When you run the tests, the test runner will copy the data directory to `out/vscode-tests/*/data`.
106+
105107
#### Running the tests
106108

109+
Pre-requisites:
110+
1. Run `npm run build`.
111+
2. You will need to have `npm run watch` running in the background.
112+
107113
##### 1. From the terminal
108114

109-
First move into the `extensions/ql-vscode` directory. Then, depending on which tests you want to run, use the appropriate command to run the tests:
115+
Then, from the `extensions/ql-vscode` directory, use the appropriate command to run the tests:
110116

111117
* Unit tests: `npm run test:unit`
112118
* View Tests: `npm test:view`

extensions/ql-vscode/gulpfile.ts/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as gulp from 'gulp';
22
import { compileTypeScript, watchTypeScript, cleanOutput } from './typescript';
33
import { compileTextMateGrammar } from './textmate';
4-
import { copyTestData } from './tests';
4+
import { copyTestData, watchTestData } from './tests';
55
import { compileView, watchView } from './webpack';
66
import { packageExtension } from './package';
77
import { injectAppInsightsKey } from './appInsights';
@@ -21,6 +21,7 @@ export {
2121
watchView,
2222
compileTypeScript,
2323
copyTestData,
24+
watchTestData,
2425
injectAppInsightsKey,
2526
compileView,
2627
};

extensions/ql-vscode/gulpfile.ts/tests.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import * as gulp from 'gulp';
22

33
export function copyTestData() {
4-
copyNoWorkspaceData();
5-
copyCliIntegrationData();
6-
return Promise.resolve();
4+
return Promise.all([
5+
copyNoWorkspaceData(),
6+
copyCliIntegrationData()
7+
]);
8+
}
9+
10+
export function watchTestData() {
11+
return gulp.watch(['src/vscode-tests/*/data/**/*'], copyTestData);
712
}
813

914
function copyNoWorkspaceData() {

0 commit comments

Comments
 (0)