Skip to content

Commit

Permalink
test(spanner): skip failing tests on cloud-devel and staging (#11347)
Browse files Browse the repository at this point in the history
* test(spanner): skip failing tests on cloud-devel and staging

* updated asserts to check for contains since we now are returning requestID with error message
  • Loading branch information
rahul2393 authored Dec 27, 2024
1 parent e9a8e3a commit 1513106
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion spanner/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,8 @@ func TestIntegration_SingleUse_WithQueryOptions(t *testing.T) {

func TestIntegration_TransactionWasStartedInDifferentSession(t *testing.T) {
t.Parallel()
// TODO: unskip once https://b.corp.google.com/issues/309745482 is fixed
skipOnNonProd(t)

ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
Expand Down Expand Up @@ -5332,7 +5334,7 @@ func TestIntegration_Foreign_Key_Delete_Cascade_Action(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
gotErr := tt.test()
// convert the error to lower case because resource names are in lower case for PG dialect.
if gotErr != nil && !strings.EqualFold(gotErr.Error(), tt.wantErr.Error()) {
if gotErr != nil && !strings.Contains(gotErr.Error(), tt.wantErr.Error()) {
t.Errorf("FKDC error=%v, wantErr: %v", gotErr, tt.wantErr)
} else {
tt.validate()
Expand Down Expand Up @@ -6220,6 +6222,13 @@ func skipUnsupportedPGTest(t *testing.T) {
}
}

func skipOnNonProd(t *testing.T) {
job := os.Getenv("JOB_TYPE")
if strings.Contains(job, "cloud-devel") || strings.Contains(job, "cloud-staging") {
t.Skip("Skipping test on non-production environment.")
}
}

func onlyRunForPGTest(t *testing.T) {
if testDialect != adminpb.DatabaseDialect_POSTGRESQL {
t.Skip("Skipping tests supported only in Postgres dialect.")
Expand Down

0 comments on commit 1513106

Please sign in to comment.