Skip to content

Commit b93b7fe

Browse files
authored
Fix bridge integration tests: assert globalStorage root exists, not vscode-codeql storage subdir (#73)
1 parent fbd9ad7 commit b93b7fe

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

extensions/vscode/test/suite/bridge.integration.test.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,13 @@ suite('vscode-codeql Bridge Tests', () => {
112112

113113
for (const dir of dirs.split(':')) {
114114
if (dir.length === 0) continue;
115-
const parent = path.dirname(dir);
115+
// The immediate parent (GitHub.vscode-codeql storage root) only exists
116+
// after first activation. Verify the grandparent (VS Code's globalStorage
117+
// root) which is always created by VS Code.
118+
const grandparent = path.dirname(path.dirname(dir));
116119
assert.ok(
117-
fs.existsSync(parent),
118-
`Parent of CODEQL_QUERY_RUN_RESULTS_DIRS entry does not exist: ${parent}`,
120+
fs.existsSync(grandparent),
121+
`Grandparent of CODEQL_QUERY_RUN_RESULTS_DIRS entry does not exist: ${grandparent} (from ${dir})`,
119122
);
120123
}
121124
});
@@ -133,10 +136,13 @@ suite('vscode-codeql Bridge Tests', () => {
133136

134137
for (const dir of dirs.split(':')) {
135138
if (dir.length === 0) continue;
136-
const parent = path.dirname(dir);
139+
// The immediate parent (GitHub.vscode-codeql storage root) only exists
140+
// after first activation. Verify the grandparent (VS Code's globalStorage
141+
// root) which is always created by VS Code.
142+
const grandparent = path.dirname(path.dirname(dir));
137143
assert.ok(
138-
fs.existsSync(parent),
139-
`Parent of CODEQL_MRVA_RUN_RESULTS_DIRS entry does not exist: ${parent}`,
144+
fs.existsSync(grandparent),
145+
`Grandparent of CODEQL_MRVA_RUN_RESULTS_DIRS entry does not exist: ${grandparent} (from ${dir})`,
140146
);
141147
}
142148
});

0 commit comments

Comments
 (0)