From bbf4d043bec1bd514f841d7adffcf9d6b8e393de Mon Sep 17 00:00:00 2001 From: shollyman Date: Thu, 4 Nov 2021 15:30:13 -0700 Subject: [PATCH] chore(bigquery): relax BI Engine Statistics test (#5084) Test had an expectation on BI Engine statistics presence, however test environments don't have BI resources provisioned. Relax the test. Fixes: https://github.com/googleapis/google-cloud-go/issues/5083 --- bigquery/integration_test.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/bigquery/integration_test.go b/bigquery/integration_test.go index aaf786541b07..766c56639ae1 100644 --- a/bigquery/integration_test.go +++ b/bigquery/integration_test.go @@ -2016,18 +2016,16 @@ func TestIntegration_QueryStatistics(t *testing.T) { t.Error("expected query timeline, none present") } - if qStats.BIEngineStatistics == nil { - t.Error("expected BIEngine statistics, none present") - } - - expectedMode := true - for _, m := range []string{"FULL", "PARTIAL", "DISABLED"} { - if qStats.BIEngineStatistics.BIEngineMode == m { - expectedMode = true + if qStats.BIEngineStatistics != nil { + expectedMode := false + for _, m := range []string{"FULL", "PARTIAL", "DISABLED"} { + if qStats.BIEngineStatistics.BIEngineMode == m { + expectedMode = true + } + } + if !expectedMode { + t.Errorf("unexpected BIEngineMode for BI Engine statistics, got %s", qStats.BIEngineStatistics.BIEngineMode) } - } - if !expectedMode { - t.Errorf("unexpected BIEngineMode for BI Engine statistics, got %s", qStats.BIEngineStatistics.BIEngineMode) } }