Skip to content

Commit d9c5ecf

Browse files
committed
Fix failing test and remove changelog note
1 parent 4c83805 commit d9c5ecf

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
- Add a _CodeQL: Preview Query Help_ command to generate Markdown previews of `.qhelp` query help files. This command should only be run in trusted workspaces. See https://codeql.github.com/docs/codeql-cli/testing-query-help-files for more information about query help. [#988](https://github.com/github/vscode-codeql/pull/988)
1111
- Make "Open Referenced File" command accessible from the active editor menu. [#989](https://github.com/github/vscode-codeql/pull/989)
1212
- Allow query result locations with 0 as the end column value. These are treated as the first column in the line. [#1002](https://github.com/github/vscode-codeql/pull/1002)
13-
- Change remote query support so that query files that are not in the root of the query pack can be uploaded and run. [#1009](https://github.com/github/vscode-codeql/pull/1009)
1413

1514
## 1.5.6 - 07 October 2021
1615

extensions/ql-vscode/src/run-remote-query.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface QlPack {
2121
name: string;
2222
version: string;
2323
dependencies: { [key: string]: string };
24-
defaultSuite?: Record<string, unknown>;
24+
defaultSuite?: Record<string, unknown>[];
2525
defaultSuiteFile?: Record<string, unknown>;
2626
}
2727
interface RepoListQuickPickItem extends QuickPickItem {
@@ -439,13 +439,13 @@ export async function attemptRerun(
439439
*/
440440
async function fixDefaultSuite(queryPackDir: string, packRelativePath: string): Promise<void> {
441441
const packPath = path.join(queryPackDir, 'qlpack.yml');
442-
const qlpack = (await yaml.safeLoad(await fs.readFile(packPath, 'utf8'))) as QlPack;
443-
delete qlpack.defaultSuite;
442+
const qlpack = yaml.safeLoad(await fs.readFile(packPath, 'utf8')) as QlPack;
444443
delete qlpack.defaultSuiteFile;
445444

446-
qlpack.defaultSuite = {
447-
description: 'Query suite for remote query',
448-
query: packRelativePath
449-
};
445+
qlpack.defaultSuite = [{
446+
description: 'Query suite for remote query'
447+
}, {
448+
query: packRelativePath.replace('\\', '/')
449+
}];
450450
await fs.writeFile(packPath, yaml.safeDump(qlpack));
451451
}

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ describe('Remote queries', function() {
250250
},
251251
library: false,
252252
defaultSuite: [{
253-
description: 'Query suite for remote query',
254-
query: queryPath,
253+
description: 'Query suite for remote query'
254+
}, {
255+
query: queryPath
255256
}]
256257
});
257258
}
@@ -261,12 +262,10 @@ describe('Remote queries', function() {
261262
}
262263

263264
function printDirectoryContents(dir: string) {
264-
dir;
265-
// uncomment to debug
266-
// console.log(`DIR ${dir}`);
267-
// if (!fs.existsSync(dir)) {
268-
// console.log(`DIR ${dir} does not exist`);
269-
// }
270-
// fs.readdirSync(dir).sort().forEach(f => console.log(` ${f}`));
265+
console.log(`DIR ${dir}`);
266+
if (!fs.existsSync(dir)) {
267+
console.log(`DIR ${dir} does not exist`);
268+
}
269+
fs.readdirSync(dir).sort().forEach(f => console.log(` ${f}`));
271270
}
272271
});

0 commit comments

Comments
 (0)