Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion tests/integration/tools/atlas/clusters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ function sleep(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}

// keeping it for cleanup scripts if needed
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function deleteAndWaitCluster(session: Session, projectId: string, clusterName: string): Promise<void> {
await session.apiClient.deleteCluster({
params: {
Expand All @@ -34,6 +36,17 @@ async function deleteAndWaitCluster(session: Session, projectId: string, cluster
}
}

async function deleteCluster(session: Session, projectId: string, clusterName: string): Promise<void> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than creating a new function, consider adding an argument to the existing one that indicates whether to wait for the deletion or not.

await session.apiClient.deleteCluster({
params: {
path: {
groupId: projectId,
clusterName,
},
},
});
}

async function waitCluster(
session: Session,
projectId: string,
Expand Down Expand Up @@ -64,7 +77,7 @@ describeWithAtlas("clusters", (integration) => {
const projectId = getProjectId();
if (projectId) {
const session: Session = integration.mcpServer().session;
await deleteAndWaitCluster(session, projectId, clusterName);
await deleteCluster(session, projectId, clusterName);
}
});

Expand Down
Loading