From e4f450959c975fe4513c58cc58a749df61dac4c7 Mon Sep 17 00:00:00 2001 From: Frank Natividad Date: Thu, 18 Aug 2022 09:44:39 -0700 Subject: [PATCH] test(storage): skip tests using OLM Age condition (#6538) When googleapis/google-api-go-client#1598 is released; these tests will break due to the breaking change. This is a preemptive PR to skip these tests which will be reenabled once the break is released. Co-authored-by: Chris Cotter --- storage/bucket_test.go | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/storage/bucket_test.go b/storage/bucket_test.go index 90bb1b25e4c..c6b8710fc82 100644 --- a/storage/bucket_test.go +++ b/storage/bucket_test.go @@ -25,7 +25,9 @@ import ( raw "google.golang.org/api/storage/v1" ) +// TODO(#6539): re-enable tests after breaking change is released and AgeInDays is a int64* func TestBucketAttrsToRawBucket(t *testing.T) { + t.Skip("TestBucketAttrsToRawBucket skipped: https://github.com/googleapis/google-cloud-go/issues/6539") t.Parallel() attrs := &BucketAttrs{ Name: "name", @@ -161,7 +163,7 @@ func TestBucketAttrsToRawBucket(t *testing.T) { StorageClass: "NEARLINE", }, Condition: &raw.BucketLifecycleRuleCondition{ - Age: 10, + //Age: 10, IsLive: googleapi.Bool(true), CreatedBefore: "2017-01-02", MatchesStorageClass: []string{"STANDARD"}, @@ -197,7 +199,7 @@ func TestBucketAttrsToRawBucket(t *testing.T) { Type: DeleteAction, }, Condition: &raw.BucketLifecycleRuleCondition{ - Age: 10, + //Age: 10, MatchesPrefix: []string{"testPrefix"}, MatchesSuffix: []string{"testSuffix"}, NumNewerVersions: 3, @@ -210,14 +212,16 @@ func TestBucketAttrsToRawBucket(t *testing.T) { Condition: &raw.BucketLifecycleRuleCondition{ IsLive: googleapi.Bool(false), }, - }, { + }, + { Action: &raw.BucketLifecycleRuleAction{ Type: AbortIncompleteMPUAction, }, Condition: &raw.BucketLifecycleRuleCondition{ - Age: 20, + //Age: 20, }, - }}, + }, + }, }, } if msg := testutil.Diff(got, want); msg != "" { @@ -346,7 +350,9 @@ func TestBucketAttrsToRawBucket(t *testing.T) { } } +// TODO(#6539): re-enable tests after breaking change is released and AgeInDays is a int64* func TestBucketAttrsToUpdateToRawBucket(t *testing.T) { + t.Skip("TestBucketAttrsToUpdateToRawBucket skipped: https://github.com/googleapis/google-cloud-go/issues/6539") t.Parallel() au := &BucketAttrsToUpdate{ VersioningEnabled: false, @@ -402,12 +408,12 @@ func TestBucketAttrsToUpdateToRawBucket(t *testing.T) { Lifecycle: &raw.BucketLifecycle{ Rule: []*raw.BucketLifecycleRule{ { - Action: &raw.BucketLifecycleRuleAction{Type: "Delete"}, - Condition: &raw.BucketLifecycleRuleCondition{Age: 30}, + Action: &raw.BucketLifecycleRuleAction{Type: "Delete"}, + //Condition: &raw.BucketLifecycleRuleCondition{Age: 30}, }, { - Action: &raw.BucketLifecycleRuleAction{Type: AbortIncompleteMPUAction}, - Condition: &raw.BucketLifecycleRuleCondition{Age: 13}, + Action: &raw.BucketLifecycleRuleAction{Type: AbortIncompleteMPUAction}, + //Condition: &raw.BucketLifecycleRuleCondition{Age: 13}, }, }, }, @@ -575,7 +581,9 @@ func TestAgeConditionBackwardCompat(t *testing.T) { } +// TODO(#6539): re-enable tests after breaking change is released and AgeInDays is a int64* func TestNewBucket(t *testing.T) { + t.Skip("TestNewBucket skipped: https://github.com/googleapis/google-cloud-go/issues/6539") labels := map[string]string{"a": "b"} matchClasses := []string{"STANDARD"} aTime := time.Date(2017, 1, 2, 0, 0, 0, 0, time.UTC) @@ -597,7 +605,7 @@ func TestNewBucket(t *testing.T) { StorageClass: "NEARLINE", }, Condition: &raw.BucketLifecycleRuleCondition{ - Age: 10, + // Age: 10, IsLive: googleapi.Bool(true), CreatedBefore: "2017-01-02", MatchesStorageClass: matchClasses,