You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/testing.md
+47-10Lines changed: 47 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,25 +4,40 @@
4
4
5
5
## Overview
6
6
7
-
Every release of the CodeQL Development MCP Server is validated through three progressively broader layers of testing. Each layer builds on the previous one, moving from fast unit checks to real-world agentic validation.
7
+
Every release of the CodeQL Development MCP Server is validated through four progressively broader layers of testing. Each layer builds on the previous one, moving from fast unit checks to real-world agentic validation.
-**Run command**: `npm run test:coverage -w extensions/vscode` (or `npm run test:vscode` from the repo root, which also runs integration tests).
35
+
-**Conventions**: Same AAA pattern and naming conventions as the server unit tests.
36
+
24
37
## Layer 2 — Integration Tests
25
38
39
+
### 2a — MCP tool integration tests
40
+
26
41
Integration tests exercise individual MCP tools against a live server instance using the custom MCP client.
27
42
28
43
-**Client**: `client/src/ql-mcp-client.js` — starts the MCP server, invokes tools, and validates results.
@@ -33,6 +48,22 @@ Integration tests exercise individual MCP tools against a live server instance u
33
48
- No mocks — tests use real CodeQL databases and queries bundled under `server/ql/`.
34
49
- The `before/monitoring-state.json` file supplies tool arguments. For file-based tests, the integration-test runner diffs filesystem state from `before/` to `after/`; for monitoring-based tests, `after/` artifacts are generally not diffed and are only interpreted for specific validations (for example, `codeql_query_run` interpreted output).
35
50
51
+
### 2b — Extension integration tests
52
+
53
+
Extension integration tests run inside a real VS Code Extension Development Host with the full VS Code API. They validate activation, MCP server registration, CodeQL extension bridging, and workspace-aware scenarios.
-**Location**: `extensions/vscode/test/suite/**/*.integration.test.ts` (compiled to `dist/test/suite/*.test.cjs` by esbuild).
57
+
-**Configuration**: `extensions/vscode/.vscode-test.mjs` — defines three test profiles:
58
+
-`noWorkspace` — no workspace folder open
59
+
-`singleFolder` — single-folder workspace fixture
60
+
-`multiRoot` — multi-root workspace fixture
61
+
-**Run commands**:
62
+
-`npm run test:integration -w extensions/vscode` — run all profiles
63
+
-`npm run test:integration:label -w extensions/vscode -- noWorkspace` — run a single profile
64
+
-**Prerequisites**: `npm run bundle -w extensions/vscode` must be run first to compile the extension and test suite.
65
+
-**CI**: Runs under `xvfb-run` on Linux for headless display support (see `.github/workflows/build-and-test-extension.yml`).
66
+
36
67
## Layer 3 — Agentic Validation
37
68
38
69
Agentic validation uses GitHub Copilot agents and skills to solve CodeQL query development challenges, exercising MCP tools in realistic end-to-end scenarios.
@@ -49,14 +80,20 @@ Agentic validation uses GitHub Copilot agents and skills to solve CodeQL query d
49
80
From the repository root:
50
81
51
82
```bash
52
-
# Build everything and run all layers (unit + integration)
83
+
# Build everything and run all layers (1a + 1b + 2a + 2b)
53
84
npm run build-and-test
54
85
55
-
# Run only unit tests
86
+
# Run only server unit tests (1a)
56
87
npm run test:server
57
88
58
-
# Run only integration tests
89
+
# Run extension unit tests + integration tests (1b + 2b)
90
+
npm run test:vscode
91
+
92
+
# Run only MCP tool integration tests (2a)
59
93
npm run test:client
94
+
95
+
# Run only extension integration tests (2b)
96
+
npm run test:integration -w extensions/vscode
60
97
```
61
98
62
-
> **Note**: Layer 3 (agentic validation) runs as part of the CI/CD pipeline via GitHub Actions workflows and is not included in the local `build-and-test` command.
99
+
> **Note**: `npm run test:vscode` runs `npm test -w extensions/vscode`, which executes both Vitest unit tests (`test:coverage`) and Extension Host integration tests (`test:integration`) in sequence. Layer 3 (agentic validation) runs as part of the CI/CD pipeline via GitHub Actions workflows and is not included in the local `build-and-test` command.
Copy file name to clipboardExpand all lines: extensions/vscode/package.json
+18-6Lines changed: 18 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"name": "vscode-codeql-development-mcp-server",
3
3
"displayName": "CodeQL Development MCP Server",
4
-
"description": "Automatically installs, configures, and manages the CodeQL Development MCP Server in VS Code.",
4
+
"description": "LLM-assisted development of CodeQL queries, libraries, and tests via #ql-mcp prompts, resources, and tools.",
5
5
"version": "2.24.1",
6
6
"publisher": "advanced-security",
7
7
"license": "SEE LICENSE IN LICENSE",
@@ -65,7 +65,9 @@
65
65
},
66
66
"codeql-mcp.serverArgs": {
67
67
"type": "array",
68
-
"items": { "type": "string" },
68
+
"items": {
69
+
"type": "string"
70
+
},
69
71
"default": [],
70
72
"description": "Custom arguments for the MCP server command. When empty, the bundled server entry point is used automatically. Set to e.g. ['/path/to/server/dist/codeql-development-mcp-server.js'] for local development."
71
73
},
@@ -84,19 +86,25 @@
84
86
},
85
87
"codeql-mcp.additionalDatabaseDirs": {
86
88
"type": "array",
87
-
"items": { "type": "string" },
89
+
"items": {
90
+
"type": "string"
91
+
},
88
92
"default": [],
89
93
"description": "Additional directories to search for CodeQL databases. Appended to CODEQL_DATABASES_BASE_DIRS alongside the vscode-codeql storage paths."
90
94
},
91
95
"codeql-mcp.additionalMrvaRunResultsDirs": {
92
96
"type": "array",
93
-
"items": { "type": "string" },
97
+
"items": {
98
+
"type": "string"
99
+
},
94
100
"default": [],
95
101
"description": "Additional directories containing MRVA run result subdirectories. Appended to CODEQL_MRVA_RUN_RESULTS_DIRS alongside the vscode-codeql variant analysis storage path."
96
102
},
97
103
"codeql-mcp.additionalQueryRunResultsDirs": {
98
104
"type": "array",
99
-
"items": { "type": "string" },
105
+
"items": {
106
+
"type": "string"
107
+
},
100
108
"default": [],
101
109
"description": "Additional directories containing query run result subdirectories. Appended to CODEQL_QUERY_RUN_RESULTS_DIRS alongside the vscode-codeql query storage path."
0 commit comments