Skip to content

Commit 007924a

Browse files
dcramerclaudecodex
authored
test(cloudflare): Run server tests under vitest-pool-workers (#678)
Move the `mcp-cloudflare` server tests onto `@cloudflare/vitest-pool-workers` so they run inside the same workerd-style runtime we ship in production. This replaces the split test setup with a single Vitest configuration, switches HTTP mocking to Cloudflare-native `fetchMock`, and adds route-level coverage for the app surface that now depends on that worker runtime behavior. The branch also updates the shared mocks package so the new tests and the existing core tests can reuse the same fixture payloads. I kept the worker-specific compatibility pieces that were needed to make the MCP SDK load correctly in tests, including the AJV stub and the worker JSON schema validator path in the handler. After rebasing onto `main`, I also aligned the static-route expectations and restored the mock fixtures needed for the full repo test suite to pass. Coverage-specific setup was removed as part of this migration because it was conflicting with the worker pool setup and was not needed for the current CI path. --------- Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: Codex <noreply@openai.com> Co-authored-by: Codex GPT-5 <codex@openai.com>
1 parent a468da8 commit 007924a

43 files changed

Lines changed: 2920 additions & 1695 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/eval.yml‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,4 @@ jobs:
193193
});
194194
195195
console.log(`✅ Check run created with conclusion: ${conclusion}`);
196-
console.log(` Average Score: ${avgScore.toFixed(2)}`);
197-
198-
- name: Upload coverage reports to Codecov
199-
uses: codecov/codecov-action@v4
200-
env:
201-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
202-
with:
203-
flags: evals
204-
name: codecov-evals
205-
fail_ci_if_error: false
206-
207-
- name: Upload results to Codecov
208-
if: ${{ !cancelled() }}
209-
uses: codecov/test-results-action@v1
210-
with:
211-
token: ${{ secrets.CODECOV_TOKEN }}
196+
console.log(` Average Score: ${avgScore.toFixed(2)}`);

‎.github/workflows/test.yml‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,6 @@ jobs:
5050
- name: Run tests
5151
run: pnpm test:ci
5252

53-
- name: Upload coverage reports to Codecov
54-
uses: codecov/codecov-action@v4
55-
env:
56-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
57-
with:
58-
flags: unittests
59-
name: codecov-unittests
60-
fail_ci_if_error: false
61-
62-
- name: Upload results to Codecov
63-
if: ${{ !cancelled() }}
64-
uses: codecov/test-results-action@v1
65-
with:
66-
token: ${{ secrets.CODECOV_TOKEN }}
67-
6853
- name: Publish Test Report
6954
uses: mikepenz/action-junit-report@cf701569b05ccdd861a76b8607a66d76f6fd4857
7055
if: ${{ !cancelled() }}

‎codecov.yml‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"dependencies": {
4444
"@biomejs/biome": "catalog:",
4545
"@types/node": "catalog:",
46-
"@vitest/coverage-v8": "catalog:",
4746
"dotenv": "catalog:",
4847
"dotenv-cli": "catalog:",
4948
"lint-staged": "catalog:",
@@ -74,7 +73,8 @@
7473
"workerd"
7574
],
7675
"overrides": {
77-
"@modelcontextprotocol/sdk": "^1.26.0"
76+
"@modelcontextprotocol/sdk": "^1.26.0",
77+
"undici": "^7.24.4"
7878
}
7979
},
8080
"devDependencies": {

‎packages/mcp-cloudflare/package.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@
2121
"preview": "vite preview",
2222
"cf-typegen": "wrangler types",
2323
"test": "vitest run",
24-
"test:ci": "vitest run --coverage --reporter=default --reporter=junit --outputFile=tests.junit.xml",
24+
"test:ci": "vitest run --reporter=default --reporter=junit --outputFile=tests.junit.xml",
2525
"test:watch": "vitest",
2626
"tsc": "tsc --noEmit"
2727
},
2828
"devDependencies": {
2929
"@cloudflare/vite-plugin": "^1.13.15",
30+
"@cloudflare/vitest-pool-workers": "catalog:",
3031
"@cloudflare/workers-types": "catalog:",
3132
"@sentry/mcp-core": "workspace:*",
3233
"@sentry/mcp-server-mocks": "workspace:*",
@@ -42,7 +43,7 @@
4243
"urlpattern-polyfill": "^10.1.0",
4344
"vite": "catalog:",
4445
"vitest": "catalog:",
45-
"wrangler": "^4.45.0"
46+
"wrangler": "4.59.2"
4647
},
4748
"dependencies": {
4849
"@ai-sdk/mcp": "catalog:",

0 commit comments

Comments
 (0)