Skip to content

Commit 197e9f8

Browse files
committed
More fixes for PR review feedback
Improves end-to-end extension integration tests such that the 'CODEQL_MCP_WORKSPACE' env var is passed to StdioClientTransport, which ensures that the server's relative-path resolution uses a deterministic diretory instead of depending upon the Extension Host's working directory.
1 parent 8228a64 commit 197e9f8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

extensions/vscode/test/suite/mcp-prompt-e2e.integration.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,12 @@ suite('MCP Prompt Error Handling Integration Tests', () => {
7171

7272
const serverPath = resolveServerPath();
7373

74+
const workspaceDir =
75+
vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? ext.extensionUri.fsPath;
76+
7477
const env: Record<string, string> = {
7578
...process.env as Record<string, string>,
79+
CODEQL_MCP_WORKSPACE: workspaceDir,
7680
TRANSPORT_MODE: 'stdio',
7781
};
7882

server/test/src/prompts/workflow-prompts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,7 @@ describe('Workflow Prompts', () => {
17771777
});
17781778
const text = result.messages[0].content.text;
17791779
expect(text).toContain('does not exist');
1780-
// Verify the warning contains the resolved absolute path
1780+
// Verify the warning mentions the provided queryPath value
17811781
expect(text).toContain('nonexistent/query.ql');
17821782
});
17831783

0 commit comments

Comments
 (0)