Skip to content

Commit dc70c7a

Browse files
committed
remove project clean up and update
1 parent 157e10d commit dc70c7a

File tree

2 files changed

+20
-30
lines changed

2 files changed

+20
-30
lines changed

tests/integration/tools/atlas/atlasHelpers.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { ApiClient } from "../../../../src/common/atlas/apiClient.js";
44
import type { IntegrationTest } from "../../helpers.js";
55
import { setupIntegrationTest, defaultTestConfig, defaultDriverOptions } from "../../helpers.js";
66
import type { SuiteCollector } from "vitest";
7-
import { afterAll, beforeAll, describe } from "vitest";
7+
import { beforeAll, describe } from "vitest";
88

99
export type IntegrationTestFunction = (integration: IntegrationTest) => void;
1010

@@ -60,20 +60,6 @@ export function withProject(integration: IntegrationTest, fn: ProjectTestFunctio
6060
}
6161
});
6262

63-
afterAll(async () => {
64-
const apiClient = integration.mcpServer().session.apiClient;
65-
if (projectId) {
66-
// projectId may be empty if beforeAll failed.
67-
await apiClient.deleteProject({
68-
params: {
69-
path: {
70-
groupId: projectId,
71-
},
72-
},
73-
});
74-
}
75-
});
76-
7763
const args = {
7864
getProjectId: (): string => projectId,
7965
getIpAddress: (): string => ipAddress,

tests/integration/tools/atlas/clusters.test.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,25 @@ function sleep(ms: number): Promise<void> {
88
return new Promise((resolve) => setTimeout(resolve, ms));
99
}
1010

11-
// keeping it for cleanup scripts if needed
12-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
13-
async function deleteAndWaitCluster(session: Session, projectId: string, clusterName: string): Promise<void> {
14-
await deleteCluster(session, projectId, clusterName);
11+
async function deleteCluster(
12+
session: Session,
13+
projectId: string,
14+
clusterName: string,
15+
wait: boolean = false
16+
): Promise<void> {
17+
await session.apiClient.deleteCluster({
18+
params: {
19+
path: {
20+
groupId: projectId,
21+
clusterName,
22+
},
23+
},
24+
});
25+
26+
if (!wait) {
27+
return;
28+
}
29+
1530
while (true) {
1631
try {
1732
await session.apiClient.getCluster({
@@ -29,17 +44,6 @@ async function deleteAndWaitCluster(session: Session, projectId: string, cluster
2944
}
3045
}
3146

32-
async function deleteCluster(session: Session, projectId: string, clusterName: string): Promise<void> {
33-
await session.apiClient.deleteCluster({
34-
params: {
35-
path: {
36-
groupId: projectId,
37-
clusterName,
38-
},
39-
},
40-
});
41-
}
42-
4347
async function waitCluster(
4448
session: Session,
4549
projectId: string,

0 commit comments

Comments
 (0)