Skip to content

Commit

Permalink
SNOW-949229 Adjust TestPutOverwrite to GCP downscoped tokens (#964)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pfus authored Nov 13, 2023
1 parent 730c03c commit 0ff9fa8
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions put_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,7 @@ func TestPutOverwrite(t *testing.T) {
if err = rows.Scan(&s0, &s1, &s2, &s3, &s4, &s5, &s6, &s7); err != nil {
t.Fatal(err)
}
if runningOnGCP() && s6 != uploaded.String() {
// when this condition fails it means, that presgined URLs are replaced with downscoped tokens
// when it happens, all clouds should not overwrite by default, so all clouds should pass the `s6 == skipped` test
t.Fatalf("expected UPLOADED as long as presigned URLs are used, got %v", s6)
} else if !runningOnGCP() && s6 != skipped.String() {
if s6 != skipped.String() {
t.Fatalf("expected SKIPPED, got %v", s6)
}

Expand All @@ -352,13 +348,7 @@ func TestPutOverwrite(t *testing.T) {
if err = rows.Scan(&s0, &s1, &s2, &s3); err != nil {
t.Fatal(err)
}
if runningOnGCP() {
if s2 == md5Column {
// when this condition fails it means, that presgined URLs are replaced with downscoped tokens
// when it happens, all clouds should not overwrite by default, so all clouds should pass the `s2 == md5Column` check
t.Fatal("For GCP and presigned URLs (current on Github Actions) it should be overwritten by default")
}
} else if s2 != md5Column {
if s2 != md5Column {
t.Fatal("The MD5 column should have stayed the same")
}

Expand Down

0 comments on commit 0ff9fa8

Please sign in to comment.