Skip to content

Commit 2b0d5e6

Browse files
committed
test(mongodb-mcp-remote): add cloud-dev e2e test skeleton + CI wiring (MCP-538)
Stack the real cloud-dev e2e tier on the unit/integration setup: - wrapper.e2e.test.ts: runs in the normal suite but self-skips via describe.skipIf unless MDB_MCP_REMOTE_E2E_CLIENT_ID is set (and on SKIP_REMOTE_MCP_E2E=true). Bodies are it.todo for MCP-539 against the real wrapper (MCP-536). - code-health.yml run-tests: inject MDB_MCP_REMOTE_E2E_* from dedicated TEST_REMOTE_MCP_* secrets/var (kept separate from MDB_MCP_API_* so cloud-dev creds don't leak into other tests). Until the secrets exist, e2e self-skips. - scripts/path-b-smoke-test.sh: one-time provisioning of the ingress credentials via the group-level mcpConfig flow. - Document e2e testing, provisioning, and secret rotation in CONTRIBUTING.md.
1 parent d6ebd8b commit 2b0d5e6

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/code-health.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ jobs:
4949
SKIP_ATLAS_LOCAL_TESTS: "true"
5050
MDB_MONGOT_PASSWORD: ${{ secrets.TEST_MDB_MONGOT_PASSWORD }}
5151
MDB_VOYAGE_API_KEY: ${{ secrets.TEST_MDB_MCP_VOYAGE_API_KEY }}
52+
MDB_MCP_REMOTE_E2E_CLIENT_ID: ${{ secrets.TEST_REMOTE_MCP_CLIENT_ID }}
53+
MDB_MCP_REMOTE_E2E_CLIENT_SECRET: ${{ secrets.TEST_REMOTE_MCP_CLIENT_SECRET }}
54+
MDB_MCP_REMOTE_E2E_BASE_URL: ${{ vars.TEST_REMOTE_MCP_BASE_URL }}
5255
- name: Upload test results
5356
if: always() && matrix.os == 'ubuntu-latest' && matrix.node-version == '22'
5457
uses: actions/upload-artifact@v7.0.1

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ pnpm --filter mongodb-mcp-remote test
8888
- **Unit** tests mock the network, so they need no external setup.
8989
- **Integration** tests spawn the built wrapper (`dist/cli.js`) over stdio and drive it
9090
against an in-process mock remote MCP server (`src/testHelpers/mockRemote.ts`), so they run deterministically.
91+
- **End-to-end** tests (`src/wrapper.e2e.test.ts`) hit the real cloud-dev Remote MCP server.
92+
They run in the normal `pnpm test` but are skipped unless `MDB_MCP_REMOTE_E2E_CLIENT_ID`
93+
is set, and skip when `SKIP_REMOTE_MCP_E2E=true`.
94+
In CI the `run-tests` job injects `MDB_MCP_REMOTE_E2E_*` from the `TEST_REMOTE_MCP_*`
95+
GitHub secrets/var; until those are registered the e2e tests self-skip and CI stays green.
9196

9297
#### Accuracy Tests and colima
9398

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { describe, it } from "vitest";
2+
3+
/**
4+
* These run in the default test flow but are skipped unless real ingress
5+
* service-account credentials are present, so runs without secrets are not impacted.
6+
*
7+
* Skip when:
8+
* - SKIP_REMOTE_MCP_E2E=true, or
9+
* - no MDB_MCP_REMOTE_E2E_CLIENT_ID is set
10+
* TODO: The tests below will be implemented in by MCP-539 once wrapper is code complete (MCP-536).
11+
*/
12+
const skipE2E = process.env.SKIP_REMOTE_MCP_E2E === "true" || !process.env.MDB_MCP_REMOTE_E2E_CLIENT_ID;
13+
14+
describe.skipIf(skipE2E)("mongodb-mcp-remote wrapper (e2e, cloud-dev)", () => {
15+
it.todo("acquires a token from the configured Atlas endpoint and lists tools");
16+
// Spawn the built wrapper against MDB_MCP_API_* (cloud-dev ingress creds), then:
17+
// const res = await client.listTools();
18+
// expect(res.tools.length).toBeGreaterThan(0);
19+
20+
it.todo("invokes a read-only tool end-to-end against cloud-dev");
21+
22+
it.todo("surfaces a clear auth error when the ingress credentials are invalid");
23+
});

0 commit comments

Comments
 (0)