Skip to content

Commit

Permalink
replacing gcloud command with storage client to delete GCS object (#2520
Browse files Browse the repository at this point in the history
)

* refactored code

* fixed lint

* replacing gcloud with storageclient in deletegcsobject in gzip_test

---------

Co-authored-by: Vipin Yadav <[email protected]>
  • Loading branch information
anushka567 and vipnydav authored Sep 24, 2024
1 parent 847d810 commit 3fa2c49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/integration_tests/gzip/gzip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ func setup_testdata(m *testing.M, ctx context.Context) error {
return nil
}

func destroy_testdata(m *testing.M) error {
func destroy_testdata(m *testing.M, ctx context.Context, storageClient *storage.Client) error {
for _, gcsObjectPath := range gcsObjectsToBeDeletedEventually {
err := operations.DeleteGcsObject(gcsObjectPath)
err := client.DeleteObjectOnGCS(ctx, storageClient, gcsObjectPath)
if err != nil {
return fmt.Errorf("Failed to delete gcs object gs://%s", gcsObjectPath)
}
Expand Down Expand Up @@ -224,7 +224,7 @@ func TestMain(m *testing.M) {
}

defer func() {
err := destroy_testdata(m)
err := destroy_testdata(m, ctx, storageClient)
if err != nil {
log.Printf("Failed to destoy gzip test data: %v", err)
}
Expand Down

0 comments on commit 3fa2c49

Please sign in to comment.