Skip to content

Commit 044bc30

Browse files
committed
Clarify how to run CLI tests locally
Also, remove an errant `only`, which was preventing some tests from running.
1 parent 9c72e81 commit 044bc30

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.vscode/launch.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989
"--extensionDevelopmentPath=${workspaceRoot}/extensions/ql-vscode",
9090
"--extensionTestsPath=${workspaceRoot}/extensions/ql-vscode/out/vscode-tests/cli-integration/index",
9191
"${workspaceRoot}/extensions/ql-vscode/src/vscode-tests/cli-integration/data",
92+
// Add a path to a checked out instance of the codeql repository so the libraries are
93+
// available in the workspace for the tests.
94+
// "${workspaceRoot}/../codeql"
9295
],
9396
"stopOnEntry": false,
9497
"sourceMaps": true,

extensions/ql-vscode/src/vscode-tests/cli-integration/run-cli.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('Use cli', function() {
4040
]);
4141
});
4242

43-
it.only('should resolve query packs', async function() {
43+
it('should resolve query packs', async function() {
4444
skipIfNoCodeQL(this);
4545
const qlpacks = await cli.resolveQlpacks(getOnDiskWorkspaceFolders());
4646
// should have a bunch of qlpacks. just check that a few known ones exist

extensions/ql-vscode/src/vscode-tests/ensureCli.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export async function ensureCli(useCli: boolean) {
7272
console.log('Total content size', Math.round(contentLength / _1MB), 'MB');
7373
const archiveFile = fs.createWriteStream(downloadedFilePath);
7474
const body = assetStream.body;
75-
await new Promise((resolve, reject) => {
75+
await new Promise<void>((resolve, reject) => {
7676
let numBytesDownloaded = 0;
7777
let lastMessage = 0;
7878
body.on('data', (data) => {
@@ -117,7 +117,11 @@ function hasCodeQL() {
117117

118118
export function skipIfNoCodeQL(context: Mocha.Context) {
119119
if (!hasCodeQL()) {
120-
console.log('The CodeQL libraries are not available as a folder in this workspace. To fix: checkout the github/codeql repository and set the TEST_CODEQL_PATH environment variable to the checked out directory.');
120+
console.log([
121+
'The CodeQL libraries are not available as a folder in this workspace.',
122+
'To fix in CI: checkout the github/codeql repository and set the \'TEST_CODEQL_PATH\' environment variable to the checked out directory.',
123+
'To fix when running from vs code, see the comment in the launch.json file in the \'Launch Integration Tests - With CLI\' section.'
124+
].join('\n\n'));
121125
context.skip();
122126
}
123127
}

0 commit comments

Comments
 (0)