Skip to content

Commit

Permalink
storage: cleanup after gs e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstruck committed Nov 21, 2017
1 parent 10a1148 commit c02f9f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion storage/gs.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ func (gs *GSBackend) Get(ctx context.Context, rawurl string, hostPath string, cl

} else if class == tes.FileType_DIRECTORY {
// TODO not handling pagination
objects, _ := gs.svc.Objects.List(url.bucket).Prefix(url.path).Do()
objects, err := gs.svc.Objects.List(url.bucket).Prefix(url.path).Do()
if err != nil {
return err
}
for _, obj := range objects.Items {
call := gs.svc.Objects.Get(url.bucket, obj.Name)
key := strings.TrimPrefix(obj.Name, url.path)
Expand Down
7 changes: 5 additions & 2 deletions tests/storage/gs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ func (g *gsTest) createBucket(projectID, bucket string) error {
}

func (g *gsTest) deleteBucket(bucket string) error {
// emptyBucket(g.bucket)
// g.client.Buckets.Delete(g.bucket)
objects, _ := g.client.Objects.List(bucket).Do()
for _, obj := range objects.Items {
g.client.Objects.Delete(bucket, obj.Name).Do()
}
g.client.Buckets.Delete(bucket).Do()
return nil
}

0 comments on commit c02f9f7

Please sign in to comment.