Skip to content

Commit 080790c

Browse files
committed
Address latest feedback for PR #153
1 parent 520a3cc commit 080790c

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"$schema":"https://json.schemastore.org/sarif-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"CodeQL","organization":"GitHub","semanticVersion":"2.24.3","rules":[{"id":"test/query","name":"test/query","shortDescription":{"text":"ExampleQuery1"},"fullDescription":{"text":"Example query for integration testing of the codeql_test_extract MCP server tool."},"defaultConfiguration":{"enabled":true,"level":"warning"},"help":{"text":"# Query Help for JavaScript ExampleQuery1\n\nTODO\n","markdown":"# Query Help for JavaScript ExampleQuery1\n\nTODO\n"},"properties":{"tags":["mcp-integration-tests"],"description":"Example query for integration testing of the codeql_test_extract MCP server tool.","id":"test/query","kind":"problem","name":"ExampleQuery1","precision":"medium","problem.severity":"warning"}}]},"extensions":[{"name":"mcp-client-integration-tests-static-javascript-src","semanticVersion":"0.0.1+fe0e7d2a7059ebb6c6075ff8eaea04f382747656","locations":[{"uri":"file:///home/runner/work/codeql-development-mcp-server/codeql-development-mcp-server/client/integration-tests/static/javascript/src/","description":{"text":"The QL pack root directory."},"properties":{"tags":["CodeQL/LocalPackRoot"]}},{"uri":"file:///home/runner/work/codeql-development-mcp-server/codeql-development-mcp-server/client/integration-tests/static/javascript/src/codeql-pack.yml","description":{"text":"The QL pack definition file."},"properties":{"tags":["CodeQL/LocalPackDefinitionFile"]}}]},{"name":"codeql/javascript-all","semanticVersion":"2.6.11+ce9c8e6e9fd41ef0967b13849bb6ae2183caf9ad","locations":[{"uri":"file:///home/runner/.codeql/packages/codeql/javascript-all/2.6.11/","description":{"text":"The QL pack root directory."},"properties":{"tags":["CodeQL/LocalPackRoot"]}},{"uri":"file:///home/runner/.codeql/packages/codeql/javascript-all/2.6.11/qlpack.yml","description":{"text":"The QL pack definition file."},"properties":{"tags":["CodeQL/LocalPackDefinitionFile"]}}]},{"name":"codeql/threat-models","semanticVersion":"1.0.31+ce9c8e6e9fd41ef0967b13849bb6ae2183caf9ad","locations":[{"uri":"file:///home/runner/.codeql/packages/codeql/threat-models/1.0.31/","description":{"text":"The QL pack root directory."},"properties":{"tags":["CodeQL/LocalPackRoot"]}},{"uri":"file:///home/runner/.codeql/packages/codeql/threat-models/1.0.31/qlpack.yml","description":{"text":"The QL pack definition file."},"properties":{"tags":["CodeQL/LocalPackDefinitionFile"]}}]}]},"artifacts":[{"location":{"uri":"file:///home/runner/work/codeql-development-mcp-server/codeql-development-mcp-server/client/integration-tests/static/javascript/test/ExampleQuery1/ExampleQuery1.js","index":0}}],"results":[{"ruleId":"test/query","ruleIndex":0,"rule":{"id":"test/query","index":0},"message":{"text":"Example test code file found for codeql_test_extract example query."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"file:///home/runner/work/codeql-development-mcp-server/codeql-development-mcp-server/client/integration-tests/static/javascript/test/ExampleQuery1/ExampleQuery1.js","index":0}}}]}],"columnKind":"utf16CodeUnits","properties":{"semmle.formatSpecifier":"sarif-latest"}}]}
1+
{"$schema":"https://json.schemastore.org/sarif-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"CodeQL","organization":"GitHub","semanticVersion":"2.25.0","rules":[{"id":"test/query","name":"test/query","shortDescription":{"text":"ExampleQuery1"},"fullDescription":{"text":"Example query for integration testing of the codeql_test_extract MCP server tool."},"defaultConfiguration":{"enabled":true,"level":"warning"},"help":{"text":"# Query Help for JavaScript ExampleQuery1\n\nTODO\n","markdown":"# Query Help for JavaScript ExampleQuery1\n\nTODO\n"},"properties":{"tags":["mcp-integration-tests"],"description":"Example query for integration testing of the codeql_test_extract MCP server tool.","id":"test/query","kind":"problem","name":"ExampleQuery1","precision":"medium","problem.severity":"warning"}}]},"extensions":[{"name":"mcp-client-integration-tests-static-javascript-src","semanticVersion":"0.0.1+fe0e7d2a7059ebb6c6075ff8eaea04f382747656","locations":[{"uri":"file:///home/runner/work/codeql-development-mcp-server/codeql-development-mcp-server/client/integration-tests/static/javascript/src/","description":{"text":"The QL pack root directory."},"properties":{"tags":["CodeQL/LocalPackRoot"]}},{"uri":"file:///home/runner/work/codeql-development-mcp-server/codeql-development-mcp-server/client/integration-tests/static/javascript/src/codeql-pack.yml","description":{"text":"The QL pack definition file."},"properties":{"tags":["CodeQL/LocalPackDefinitionFile"]}}]},{"name":"codeql/javascript-all","semanticVersion":"2.6.11+ce9c8e6e9fd41ef0967b13849bb6ae2183caf9ad","locations":[{"uri":"file:///home/runner/.codeql/packages/codeql/javascript-all/2.6.11/","description":{"text":"The QL pack root directory."},"properties":{"tags":["CodeQL/LocalPackRoot"]}},{"uri":"file:///home/runner/.codeql/packages/codeql/javascript-all/2.6.11/qlpack.yml","description":{"text":"The QL pack definition file."},"properties":{"tags":["CodeQL/LocalPackDefinitionFile"]}}]},{"name":"codeql/threat-models","semanticVersion":"1.0.31+ce9c8e6e9fd41ef0967b13849bb6ae2183caf9ad","locations":[{"uri":"file:///home/runner/.codeql/packages/codeql/threat-models/1.0.31/","description":{"text":"The QL pack root directory."},"properties":{"tags":["CodeQL/LocalPackRoot"]}},{"uri":"file:///home/runner/.codeql/packages/codeql/threat-models/1.0.31/qlpack.yml","description":{"text":"The QL pack definition file."},"properties":{"tags":["CodeQL/LocalPackDefinitionFile"]}}]}]},"artifacts":[{"location":{"uri":"file:///home/runner/work/codeql-development-mcp-server/codeql-development-mcp-server/client/integration-tests/static/javascript/test/ExampleQuery1/ExampleQuery1.js","index":0}}],"results":[{"ruleId":"test/query","ruleIndex":0,"rule":{"id":"test/query","index":0},"message":{"text":"Example test code file found for codeql_test_extract example query."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"file:///home/runner/work/codeql-development-mcp-server/codeql-development-mcp-server/client/integration-tests/static/javascript/test/ExampleQuery1/ExampleQuery1.js","index":0}}}]}],"columnKind":"utf16CodeUnits","properties":{"semmle.formatSpecifier":"sarif-latest"}}]}

client/src/lib/integration-test-runner.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ export class IntegrationTestRunner {
225225
}
226226

227227
this.logger.log(`Completed ${totalIntegrationTests} tool-specific integration tests`);
228+
const toolIntegrationSucceeded = totalIntegrationTests > 0;
228229

229230
// Also run workflow integration tests
230231
const workflowIntegrationSucceeded = await this.runWorkflowIntegrationTests(baseDir);
@@ -246,15 +247,18 @@ export class IntegrationTestRunner {
246247
);
247248
}
248249

249-
if (totalIntegrationTests === 0) {
250+
const anyTestsExecuted =
251+
toolIntegrationSucceeded || workflowIntegrationSucceeded || promptIntegrationSucceeded;
252+
253+
if (!anyTestsExecuted) {
250254
this.logger.log(
251-
"No integration tests were executed across tool, workflow, or prompt suites.",
255+
"No integration tests completed successfully across tool, workflow, or prompt suites.",
252256
"ERROR"
253257
);
254258
return false;
255259
}
256260

257-
return workflowIntegrationSucceeded && promptIntegrationSucceeded;
261+
return toolIntegrationSucceeded && workflowIntegrationSucceeded && promptIntegrationSucceeded;
258262
} catch (error) {
259263
this.logger.log(`Error running integration tests: ${error.message}`, "ERROR");
260264
return false;

extensions/vscode/scripts/download-vscode.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ const version = process.argv[2] || getEnginesVscodeVersion();
3131
console.log(`Downloading VS Code (${version}) for integration tests...`);
3232

3333
try {
34-
const vscodeExecutablePath = await downloadAndUnzipVSCode(version);
34+
const vscodeExecutablePath = await downloadAndUnzipVSCode({
35+
version,
36+
timeout: 120_000,
37+
});
3538
console.log(`✅ VS Code downloaded to: ${vscodeExecutablePath}`);
3639
} catch (error) {
3740
console.error(

server/dist/codeql-development-mcp-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64378,8 +64378,8 @@ function registerLanguageResources(server) {
6437864378
}
6437964379

6438064380
// src/prompts/workflow-prompts.ts
64381-
import { basename as basename7, isAbsolute as isAbsolute7, normalize, relative, resolve as resolve13, sep as sep2 } from "path";
6438264381
import { access as access2 } from "fs/promises";
64382+
import { basename as basename7, isAbsolute as isAbsolute7, normalize, relative, resolve as resolve13, sep as sep2 } from "path";
6438364383
import { fileURLToPath as fileURLToPath3 } from "url";
6438464384

6438564385
// src/prompts/check-for-duplicated-code.prompt.md

server/dist/codeql-development-mcp-server.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/src/prompts/workflow-prompts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
99
import { z } from 'zod';
10-
import { basename, isAbsolute, normalize, relative, resolve, sep } from 'path';
1110
import { access } from 'fs/promises';
11+
import { basename, isAbsolute, normalize, relative, resolve, sep } from 'path';
1212
import { fileURLToPath } from 'url';
1313
import { loadPromptTemplate, processPromptTemplate } from './prompt-loader';
1414
import { getUserWorkspaceDir } from '../utils/package-paths';

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ describe('Workflow Prompts', () => {
12081208
expect(text).toContain('**Query Name**: WeakCrypto');
12091209
});
12101210

1211-
it('ql_tdd_basic handler (createSafePromptHandler) should return inline validation error when required parameters are missing', async () => {
1211+
it('ql_tdd_basic handler (createSafePromptHandler) should return inline validation error when called directly with missing parameters (defense-in-depth; SDK validates required fields before handler in real MCP usage)', async () => {
12121212
const handler = getRegisteredHandler(mockServer, 'ql_tdd_basic');
12131213
const result: PromptResult = await handler({});
12141214
expect(result.messages[0].content.text).toContain('Invalid input');
@@ -1227,7 +1227,7 @@ describe('Workflow Prompts', () => {
12271227
expect(text).toContain('**Query Name**: TaintTrack');
12281228
});
12291229

1230-
it('ql_tdd_advanced handler (createSafePromptHandler) should return inline validation error when required parameters are missing', async () => {
1230+
it('ql_tdd_advanced handler (createSafePromptHandler) should return inline validation error when called directly with missing parameters (defense-in-depth; SDK validates required fields before handler in real MCP usage)', async () => {
12311231
const handler = getRegisteredHandler(mockServer, 'ql_tdd_advanced');
12321232
const result: PromptResult = await handler({});
12331233
expect(result.messages[0].content.text).toContain('Invalid input');
@@ -1255,7 +1255,7 @@ describe('Workflow Prompts', () => {
12551255
expect(text).toContain('out.sarif');
12561256
});
12571257

1258-
it('sarif_rank handlers should return inline error with no parameters', async () => {
1258+
it('sarif_rank handlers (createSafePromptHandler) should return inline error when called directly with no parameters (defense-in-depth; SDK validates required sarifPath before handler in real MCP usage)', async () => {
12591259
for (const name of ['sarif_rank_false_positives', 'sarif_rank_true_positives']) {
12601260
const handler = getRegisteredHandler(mockServer, name);
12611261
const result: PromptResult = await handler({});
@@ -1272,7 +1272,7 @@ describe('Workflow Prompts', () => {
12721272
expect(text).toContain('queries/SqlInjection.ql');
12731273
});
12741274

1275-
it('run_query_and_summarize_false_positives handler should return inline error with no parameters', async () => {
1275+
it('run_query_and_summarize_false_positives handler (createSafePromptHandler) should return inline error when called directly with no parameters (defense-in-depth; SDK validates required queryPath before handler in real MCP usage)', async () => {
12761276
const handler = getRegisteredHandler(mockServer, 'run_query_and_summarize_false_positives');
12771277
const result: PromptResult = await handler({});
12781278
expect(result.messages[0].content.text).toContain('Invalid input');

0 commit comments

Comments
 (0)