Skip to content

Commit eb5ce02

Browse files
committed
Fix failing integration test
How did this ever work? It was using an old variant of the qlpack name. Also, this commit makes the unhandledRejection handler less verbose. This gets hit when the tests end and there is a cancellation. this is not an error.
1 parent 0ebff2d commit eb5ce02

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

extensions/ql-vscode/src/vscode-tests/cli-integration/global.helper.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ import { DatabaseManager } from '../../databases';
1212

1313
export const DB_URL = 'https://github.com/github/vscode-codeql/files/5586722/simple-db.zip';
1414

15-
process.addListener('unhandledRejection', (reason, p) => {
16-
console.log('Unhandled Rejection at: Promise ', p, ' reason: ', reason);
17-
fail(String(reason));
15+
process.addListener('unhandledRejection', (reason) => {
16+
if (reason instanceof Error && reason.message === 'Canceled') {
17+
console.log('Cancellation requested after the test has ended.');
18+
process.exit(0);
19+
} else {
20+
fail(String(reason));
21+
}
1822
});
1923

2024
// We need to resolve the path, but the final three segments won't exist until later, so we only resolve the

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,11 @@ describe('Queries', function() {
157157
});
158158

159159
it('should avoid creating a quick query', async () => {
160+
fs.mkdirpSync(path.dirname(qlpackFile));
160161
fs.writeFileSync(qlpackFile, yaml.dump({
161162
name: 'quick-query',
162163
version: '1.0.0',
163-
libraryPathDependencies: ['codeql-javascript']
164+
libraryPathDependencies: ['codeql/javascript-all']
164165
}));
165166
fs.writeFileSync(qlFile, 'xxx');
166167
await commands.executeCommand('codeQL.quickQuery');

0 commit comments

Comments
 (0)