From 27c71889661ae8a4ba9bc163379d361874722beb Mon Sep 17 00:00:00 2001 From: Hengfeng Li Date: Fri, 13 Sep 2024 14:15:05 +1000 Subject: [PATCH] chore(spanner): unskip pg integeration tests against emulator (#10628) Co-authored-by: rahul2393 --- spanner/emulator_test.sh | 2 +- spanner/integration_test.go | 13 ------------- spanner/oc_test.go | 2 +- spanner/row_test.go | 2 +- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/spanner/emulator_test.sh b/spanner/emulator_test.sh index 8fe69dba7e82..9eab68fffe20 100755 --- a/spanner/emulator_test.sh +++ b/spanner/emulator_test.sh @@ -37,7 +37,7 @@ EMULATOR_PID=$! # Stop the emulator & clean the environment variable function cleanup() { - kill -2 $EMULATOR_PID + kill -9 $EMULATOR_PID unset SPANNER_EMULATOR_HOST unset GCLOUD_TESTS_GOLANG_PROJECT_ID echo "Cleanup the emulator"; diff --git a/spanner/integration_test.go b/spanner/integration_test.go index ae2fd6f32bbe..984d0c6734b7 100644 --- a/spanner/integration_test.go +++ b/spanner/integration_test.go @@ -569,7 +569,6 @@ loop: // Test SingleUse transaction. func TestIntegration_SingleUse(t *testing.T) { t.Parallel() - skipEmulatorTestForPG(t) ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) defer cancel() @@ -6218,12 +6217,6 @@ func skipEmulatorTest(t *testing.T) { } } -func skipEmulatorTestForPG(t *testing.T) { - if isEmulatorEnvSet() && testDialect == adminpb.DatabaseDialect_POSTGRESQL { - t.Skip("Skipping PG testing against the emulator.") - } -} - func skipUnsupportedPGTest(t *testing.T) { if testDialect == adminpb.DatabaseDialect_POSTGRESQL { t.Skip("Skipping testing of unsupported tests in Postgres dialect.") @@ -6236,12 +6229,6 @@ func onlyRunForPGTest(t *testing.T) { } } -func skipForPGTest(t *testing.T) { - if testDialect == adminpb.DatabaseDialect_POSTGRESQL { - t.Skip("Skipping tests non needed for Postgres dialect.") - } -} - func verifyDirectPathRemoteAddress(t *testing.T) { t.Helper() if !dpConfig.attemptDirectPath { diff --git a/spanner/oc_test.go b/spanner/oc_test.go index f49a7bf7b0c2..089e6bbf0eb7 100644 --- a/spanner/oc_test.go +++ b/spanner/oc_test.go @@ -50,7 +50,7 @@ func TestOCStats(t *testing.T) { } func TestOCStats_SessionPool(t *testing.T) { - skipForPGTest(t) + skipUnsupportedPGTest(t) DisableGfeLatencyAndHeaderMissingCountViews() // expectedValues is a map of expected values for different configurations of // multiplexed session env="GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS". diff --git a/spanner/row_test.go b/spanner/row_test.go index 463fec1d35f7..593f9ae73029 100644 --- a/spanner/row_test.go +++ b/spanner/row_test.go @@ -2100,7 +2100,7 @@ func BenchmarkColumn(b *testing.B) { } func TestSelectAll(t *testing.T) { - skipForPGTest(t) + skipUnsupportedPGTest(t) type args struct { destination interface{} options []DecodeOptions