Skip to content

Commit 9e4e3c5

Browse files
Fix MacOS tests + tool counting tests
1 parent 5c660da commit 9e4e3c5

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

tests/integration/server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe("Server integration test", () => {
1111
expectDefined(tools);
1212
expect(tools.tools.length).toBeGreaterThan(0);
1313

14-
const atlasTools = tools.tools.filter((tool) => tool.name.startsWith("atlas-"));
14+
const atlasTools = tools.tools.filter((tool) => tool.name.startsWith("atlas-") && !tool.name.startsWith("atlas-local-"));
1515
expect(atlasTools.length).toBeLessThanOrEqual(0);
1616
});
1717
},

tests/integration/tools/atlas-local/listDeployments.test.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,27 @@ import {
77
} from "../../helpers.js";
88
import { describe, expect, it } from "vitest";
99

10+
const isMacOSInGitHubActions = process.platform === 'darwin' && process.env.GITHUB_ACTIONS === 'true'
11+
1012
describe("atlas-local-list-deployments", () => {
1113
const integration = setupIntegrationTest(
1214
() => defaultTestConfig,
1315
() => defaultDriverOptions
1416
);
1517

16-
it("should have correct metadata", async () => {
18+
it.skipIf(isMacOSInGitHubActions)("should have the atlas-local-list-deployments tool", async () => {
19+
const { tools } = await integration.mcpClient().listTools();
20+
const listDeployments = tools.find((tool) => tool.name === "atlas-local-list-deployments");
21+
expectDefined(listDeployments);
22+
});
23+
24+
it.skipIf(!isMacOSInGitHubActions)("[MacOS in GitHub Actions] should not have the atlas-local-list-deployments tool", async () => {
25+
const { tools } = await integration.mcpClient().listTools();
26+
const listDeployments = tools.find((tool) => tool.name === "atlas-local-list-deployments");
27+
expect(listDeployments).toBeUndefined();
28+
});
29+
30+
it.skipIf(isMacOSInGitHubActions)("should have correct metadata", async () => {
1731
const { tools } = await integration.mcpClient().listTools();
1832
const listDeployments = tools.find((tool) => tool.name === "atlas-local-list-deployments");
1933
expectDefined(listDeployments);
@@ -22,7 +36,7 @@ describe("atlas-local-list-deployments", () => {
2236
expect(listDeployments.inputSchema.properties).toEqual({});
2337
});
2438

25-
it("should not crash when calling the tool", async () => {
39+
it.skipIf(isMacOSInGitHubActions)("should not crash when calling the tool", async () => {
2640
const response = await integration.mcpClient().callTool({
2741
name: "atlas-local-list-deployments",
2842
arguments: {},

tests/integration/transports/stdio.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describeWithMongoDB("StdioRunner", (integration) => {
1010
beforeAll(async () => {
1111
transport = new StdioClientTransport({
1212
command: "node",
13-
args: ["dist/index.js"],
13+
args: ["dist/index.js", "--disableTools", "atlas-local"],
1414
env: {
1515
MDB_MCP_TRANSPORT: "stdio",
1616
MDB_MCP_CONNECTION_STRING: integration.connectionString(),

0 commit comments

Comments
 (0)