File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed
tests/integration/tools/atlas Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
2
2
import { Session } from "../../../../src/session.js" ;
3
3
import { describeWithAtlas , withProject , randomId } from "./atlasHelpers.js" ;
4
4
import { expectDefined , getResponseElements } from "../../helpers.js" ;
5
+ import { ApiClientError } from "../../../../src/common/atlas/apiClientError.js" ;
5
6
6
7
describeWithAtlas ( "db users" , ( integration ) => {
7
8
withProject ( integration , ( { getProjectId } ) => {
@@ -28,18 +29,22 @@ describeWithAtlas("db users", (integration) => {
28
29
} ;
29
30
30
31
afterEach ( async ( ) => {
31
- const projectId = getProjectId ( ) ;
32
-
33
- const session : Session = integration . mcpServer ( ) . session ;
34
- await session . apiClient . deleteDatabaseUser ( {
35
- params : {
36
- path : {
37
- groupId : projectId ,
38
- username : userName ,
39
- databaseName : "admin" ,
32
+ try {
33
+ await integration . mcpServer ( ) . session . apiClient . deleteDatabaseUser ( {
34
+ params : {
35
+ path : {
36
+ groupId : getProjectId ( ) ,
37
+ username : userName ,
38
+ databaseName : "admin" ,
39
+ } ,
40
40
} ,
41
- } ,
42
- } ) ;
41
+ } ) ;
42
+ } catch ( error ) {
43
+ // Ignore 404 errors when deleting the user
44
+ if ( ! ( error instanceof ApiClientError ) || error . response ?. status !== 404 ) {
45
+ throw error ;
46
+ }
47
+ }
43
48
} ) ;
44
49
45
50
describe ( "atlas-create-db-user" , ( ) => {
You can’t perform that action at this time.
0 commit comments