Skip to content

Commit f6d590c

Browse files
committed
Pin code scanning pack integration fixture
Keep the code scanning resolution test compatible with all supported CLI versions while asserting that production still requests the latest language pack. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de15564b-31a3-459b-9d6b-483ebc280d76
1 parent c702b10 commit f6d590c

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

extensions/ql-vscode/test/vscode-tests/cli-integration/variant-analysis/code-scanning-pack.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,25 @@ describe("Code Scanning pack", () => {
1717
});
1818

1919
it("should download pack for correct language and identify problem queries", async () => {
20+
// Pin the registry fixture because this test covers query resolution, not pack manifest compatibility.
21+
// Remove the pin once every supported CLI can download the latest query pack.
22+
const packDownload = cli.packDownload.bind(cli);
23+
const packDownloadSpy = jest
24+
.spyOn(cli, "packDownload")
25+
.mockImplementation((_packs, token) =>
26+
packDownload(["codeql/javascript-queries@2.4.2"], token),
27+
);
28+
2029
const pack = await resolveCodeScanningQueryPack(
2130
app.logger,
2231
cli,
2332
QueryLanguage.Javascript,
2433
new CancellationTokenSource().token,
2534
);
35+
expect(packDownloadSpy).toHaveBeenCalledWith(
36+
["codeql/javascript-queries"],
37+
expect.anything(),
38+
);
2639
// Should include queries. Just check that at least one known query exists.
2740
// It doesn't particularly matter which query we check for.
2841
expect(

0 commit comments

Comments
 (0)