cloud sql pg

This commit is contained in:
duwenxin
2026-02-10 09:08:15 -05:00
parent a19f95d993
commit 0582a8293c
2 changed files with 9 additions and 9 deletions

View File

@@ -200,11 +200,10 @@ func TestCreateInstanceToolEndpoints(t *testing.T) {
want: `{"name":"op2","status":"RUNNING"}`,
},
{
name: "missing required parameter",
toolName: "create-instance-prod",
body: `{"name": "instance1"}`,
expectError: true,
errorStatus: http.StatusBadRequest,
name: "missing required parameter",
toolName: "create-instance-prod",
body: `{"name": "instance1"}`,
want: `{"error":"parameter \"project\" is required"}`,
},
}

View File

@@ -273,10 +273,11 @@ func TestPreCheckToolEndpoints(t *testing.T) {
want: `{"preCheckResponse":[{"actionsRequired":["Fix this now."],"type":"","message":"This is a critical error.","messageType":"ERROR"}]}`,
},
{
name: "instance not found",
toolName: "precheck-tool",
body: `{"project": "p1", "instance": "instance-notfound", "targetDatabaseVersion": "POSTGRES_18"}`,
want: `{"error":"Not authorized to access instance"}`,
name: "instance not found",
toolName: "precheck-tool",
body: `{"project": "p1", "instance": "instance-notfound", "targetDatabaseVersion": "POSTGRES_18"}`,
want: `{"error":"failed to access GCP resource: googleapi: got HTTP response code 403 with body: Not authorized to access instance\n"}`,
expectError: true,
},
{
name: "missing required parameter - project",