Skip to content

Commit 013bf65

Browse files
authored
Merge pull request #3585 from github/koesie10/fix-modeled-method-fs-test
Fix modeled method FS test
2 parents 596049a + bd6862e commit 013bf65

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ describe("modeled-method-fs", () => {
5555
let cli: CodeQLCliServer;
5656

5757
beforeEach(async () => {
58+
if (!process.env.TEST_CODEQL_PATH) {
59+
fail(
60+
"TEST_CODEQL_PATH environment variable not set. It should point to the absolute path to a checkout of the codeql repository.",
61+
);
62+
}
63+
5864
// On windows, make sure to use a temp directory that isn't an alias and therefore won't be canonicalised by CodeQL.
5965
// The tmp package doesn't support this, so we have to do it manually.
6066
// See https://github.com/github/vscode-codeql/pull/2605 for more context.
@@ -73,11 +79,16 @@ describe("modeled-method-fs", () => {
7379
name: "workspace",
7480
index: 0,
7581
};
82+
const codeqlWorkspaceFolder = {
83+
uri: Uri.file(process.env.TEST_CODEQL_PATH),
84+
name: "ql",
85+
index: 1,
86+
};
7687
workspacePath = workspaceFolder.uri.fsPath;
7788
mkdirSync(workspacePath);
7889
jest
7990
.spyOn(workspace, "workspaceFolders", "get")
80-
.mockReturnValue([workspaceFolder]);
91+
.mockReturnValue([workspaceFolder, codeqlWorkspaceFolder]);
8192

8293
const extension = await getActivatedExtension();
8394
cli = extension.cliServer;

0 commit comments

Comments
 (0)