Skip to content

Commit 2962306

Browse files
Specify that tmp dir is under homedir on windows
1 parent 9924f87 commit 2962306

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

extensions/ql-vscode/test/vscode-tests/cli-integration/data-extensions-editor/modeled-method-fs.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import { ExtensionPack } from "../../../../src/data-extensions-editor/shared/extension-pack";
1111
import { join } from "path";
1212
import { extLogger } from "../../../../src/common/logging/vscode";
13+
import { homedir } from "os";
1314

1415
const dummyExtensionPackContents = `
1516
name: dummy/pack
@@ -52,7 +53,14 @@ describe("modeled-method-fs", () => {
5253
let cli: CodeQLCliServer;
5354

5455
beforeEach(async () => {
55-
const t = tmp.dirSync();
56+
// On windows, make sure to use a temp directory that isn't an alias and therefore won't be canonicalised by CodeQL.
57+
// See https://github.com/github/vscode-codeql/pull/2605 for more context.
58+
const t = tmp.dirSync({
59+
dir:
60+
process.platform === "win32"
61+
? join(homedir(), "AppData", "Local", "Temp")
62+
: undefined,
63+
});
5664
tmpDir = t.name;
5765
tmpDirRemoveCallback = t.removeCallback;
5866

0 commit comments

Comments
 (0)