Skip to content

Commit 38420ef

Browse files
authored
Merge branch 'main' into fix/spanner-resource-cleanup
2 parents 8cb5311 + 28a4910 commit 38420ef

62 files changed

Lines changed: 92 additions & 79 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/alloydb/alloydb_integration_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func TestAlloyDBToolEndpoints(t *testing.T) {
151151
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
152152
defer cancel()
153153

154-
var args []string
154+
args := []string{"--enable-api"}
155155
toolsFile := getAlloyDBToolsConfig()
156156

157157
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile, args...)
@@ -1099,7 +1099,7 @@ func TestAlloyDBCreateCluster(t *testing.T) {
10991099
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
11001100
defer cancel()
11011101

1102-
var args []string
1102+
args := []string{"--enable-api"}
11031103
toolsFile := getAlloyDBToolsConfig()
11041104
cmd, cleanupCmd, err := tests.StartCmd(ctx, toolsFile, args...)
11051105
if err != nil {
@@ -1209,7 +1209,7 @@ func TestAlloyDBCreateInstance(t *testing.T) {
12091209
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
12101210
defer cancel()
12111211

1212-
var args []string
1212+
args := []string{"--enable-api"}
12131213
toolsFile := getAlloyDBToolsConfig()
12141214
cmd, cleanupCmd, err := tests.StartCmd(ctx, toolsFile, args...)
12151215
if err != nil {
@@ -1335,7 +1335,7 @@ func TestAlloyDBCreateUser(t *testing.T) {
13351335
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
13361336
defer cancel()
13371337

1338-
var args []string
1338+
args := []string{"--enable-api"}
13391339
toolsFile := getAlloyDBToolsConfig()
13401340
cmd, cleanupCmd, err := tests.StartCmd(ctx, toolsFile, args...)
13411341
if err != nil {

tests/alloydb/alloydb_wait_for_operation_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func TestWaitToolEndpoints(t *testing.T) {
134134
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
135135
defer cancel()
136136

137-
var args []string
137+
args := []string{"--enable-api"}
138138

139139
toolsFile := getWaitToolsConfig()
140140
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile, args...)

tests/alloydbainl/alloydb_ai_nl_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func TestAlloyDBAINLToolEndpoints(t *testing.T) {
7878
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
7979
defer cancel()
8080

81-
var args []string
81+
args := []string{"--enable-api"}
8282

8383
// Write config into a file and pass it to command
8484
toolsFile := getAINLToolsConfig(sourceConfig)

tests/alloydbomni/alloydb_omni_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func TestAlloyDBOmni(t *testing.T) {
118118
// Generate a unique ID
119119
uniqueID := strings.ReplaceAll(uuid.New().String(), "-", "")
120120

121-
args := []string{"--prebuilt", "alloydb-omni"}
121+
args := []string{"--prebuilt", "alloydb-omni", "--enable-api"}
122122

123123
pool, err := initPostgresConnectionPool(AlloyDBHost, AlloyDBPort, AlloyDBUser, AlloyDBPass, AlloyDBDatabase)
124124
if err != nil {

tests/alloydbpg/alloydb_pg_integration_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func TestAlloyDBPgToolEndpoints(t *testing.T) {
122122
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
123123
defer cancel()
124124

125-
var args []string
125+
args := []string{"--enable-api"}
126126

127127
pool, err := initAlloyDBPgConnectionPool(AlloyDBPostgresProject, AlloyDBPostgresRegion, AlloyDBPostgresCluster, AlloyDBPostgresInstance, "public", AlloyDBPostgresUser, AlloyDBPostgresPass, AlloyDBPostgresDatabase)
128128
if err != nil {
@@ -222,7 +222,7 @@ func TestAlloyDBPgPrebuiltStatementTools(t *testing.T) {
222222
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
223223
defer cancel()
224224

225-
args := []string{"--prebuilt", "alloydb-postgres"}
225+
args := []string{"--prebuilt", "alloydb-postgres", "--enable-api"}
226226

227227
cmd, cleanup, err := tests.StartCmd(ctx, map[string]any{}, args...)
228228
if err != nil {

tests/auth/auth_integration_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ func TestMcpAuth(t *testing.T) {
8282
},
8383
"tools": map[string]any{},
8484
}
85-
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile)
85+
args := []string{"--enable-api"}
86+
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile, args...)
8687
if err != nil {
8788
t.Fatalf("command initialization returned an error: %s", err)
8889
}

tests/bigquery/bigquery_integration_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func TestBigQueryToolEndpoints(t *testing.T) {
8181
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Minute)
8282
defer cancel()
8383

84-
var args []string
84+
args := []string{"--enable-api"}
8585

8686
client, err := initBigQueryConnection(BigqueryProject)
8787
if err != nil {
@@ -336,7 +336,8 @@ func TestBigQueryToolWithDatasetRestriction(t *testing.T) {
336336
}
337337

338338
// Start server
339-
cmd, cleanup, err := tests.StartCmd(ctx, config)
339+
args := []string{"--enable-api"}
340+
cmd, cleanup, err := tests.StartCmd(ctx, config, args...)
340341
if err != nil {
341342
t.Fatalf("command initialization returned an error: %s", err)
342343
}
@@ -411,7 +412,8 @@ func TestBigQueryWriteModeAllowed(t *testing.T) {
411412
},
412413
}
413414

414-
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile)
415+
args := []string{"--enable-api"}
416+
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile, args...)
415417
if err != nil {
416418
t.Fatalf("command initialization returned an error: %s", err)
417419
}
@@ -455,7 +457,8 @@ func TestBigQueryWriteModeBlocked(t *testing.T) {
455457
},
456458
}
457459

458-
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile)
460+
args := []string{"--enable-api"}
461+
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile, args...)
459462
if err != nil {
460463
t.Fatalf("command initialization returned an error: %s", err)
461464
}
@@ -518,7 +521,8 @@ func TestBigQueryWriteModeProtected(t *testing.T) {
518521
},
519522
}
520523

521-
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile)
524+
args := []string{"--enable-api"}
525+
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile, args...)
522526
if err != nil {
523527
t.Fatalf("command initialization returned an error: %s", err)
524528
}

tests/bigtable/bigtable_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func TestBigtableToolEndpoints(t *testing.T) {
6868
uniqueID := strings.ReplaceAll(uuid.New().String(), "-", "")
6969
t.Logf("Starting Bigtable test with uniqueID: %s", uniqueID)
7070

71-
var args []string
71+
args := []string{"--enable-api"}
7272

7373
// Initialize AdminClient to create or delete tables
7474
adminClient, err := bigtable.NewAdminClient(context.Background(), sourceConfig["project"].(string), sourceConfig["instance"].(string))

tests/cassandra/cassandra_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func TestCassandra(t *testing.T) {
180180
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
181181
defer cancel()
182182

183-
var args []string
183+
args := []string{"--enable-api"}
184184
paramTableName := "param_table_" + strings.ReplaceAll(uuid.New().String(), "-", "")
185185
tableNameAuth := "auth_table_" + strings.ReplaceAll(uuid.New().String(), "-", "")
186186
tableNameTemplateParam := "template_param_table_" + strings.ReplaceAll(uuid.New().String(), "-", "")

tests/clickhouse/clickhouse_integration_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func TestClickHouse(t *testing.T) {
106106
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
107107
defer cancel()
108108

109-
var args []string
109+
args := []string{"--enable-api"}
110110

111111
pool, err := initClickHouseConnectionPool(ClickHouseHost, ClickHousePort, ClickHouseUser, ClickHousePass, ClickHouseDatabase, ClickHouseProtocol)
112112
if err != nil {
@@ -268,7 +268,7 @@ func TestClickHouseBasicConnection(t *testing.T) {
268268
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
269269
defer cancel()
270270

271-
var args []string
271+
args := []string{"--enable-api"}
272272

273273
pool, err := initClickHouseConnectionPool(ClickHouseHost, ClickHousePort, ClickHouseUser, ClickHousePass, ClickHouseDatabase, ClickHouseProtocol)
274274
if err != nil {
@@ -418,7 +418,7 @@ func TestClickHouseSQLTool(t *testing.T) {
418418
},
419419
}
420420

421-
var args []string
421+
args := []string{"--enable-api"}
422422
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile, args...)
423423
if err != nil {
424424
t.Fatalf("command initialization returned an error: %s", err)
@@ -529,7 +529,7 @@ func TestClickHouseExecuteSQLTool(t *testing.T) {
529529
},
530530
}
531531

532-
var args []string
532+
args := []string{"--enable-api"}
533533
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile, args...)
534534
if err != nil {
535535
t.Fatalf("command initialization returned an error: %s", err)
@@ -666,7 +666,7 @@ func TestClickHouseEdgeCases(t *testing.T) {
666666
},
667667
}
668668

669-
var args []string
669+
args := []string{"--enable-api"}
670670
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile, args...)
671671
if err != nil {
672672
t.Fatalf("command initialization returned an error: %s", err)
@@ -918,7 +918,7 @@ func TestClickHouseListDatabasesTool(t *testing.T) {
918918
},
919919
}
920920

921-
var args []string
921+
args := []string{"--enable-api"}
922922
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile, args...)
923923
if err != nil {
924924
t.Fatalf("command initialization returned an error: %s", err)
@@ -1047,7 +1047,7 @@ func TestClickHouseListTablesTool(t *testing.T) {
10471047
},
10481048
}
10491049

1050-
var args []string
1050+
args := []string{"--enable-api"}
10511051
cmd, cleanup, err := tests.StartCmd(ctx, toolsFile, args...)
10521052
if err != nil {
10531053
t.Fatalf("command initialization returned an error: %s", err)

0 commit comments

Comments
 (0)