Skip to content

Commit

Permalink
storage: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstruck committed Nov 21, 2017
1 parent 073b5e6 commit 68feb28
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions tests/storage/gs_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package storage

import (
gs "cloud.google.com/go/storage"
// gs "cloud.google.com/go/storage"
// "context"
"flag"
"fmt"
// "fmt"
"github.com/ohsu-comp-bio/funnel/proto/tes"
"github.com/ohsu-comp-bio/funnel/storage"
"github.com/ohsu-comp-bio/funnel/tests"
Expand All @@ -29,17 +29,17 @@ func TestGoogleStorage(t *testing.T) {

testBucket := "funnel-e2e-tests-" + tests.RandomString(6)

cli, err := newGsTest()
if err != nil {
t.Fatal(err)
}
err = cli.createBucket(projectID, testBucket)
if err != nil {
t.Fatal(err)
}
defer func() {
cli.deleteBucket(testBucket)
}()
// cli, err := newGsTest()
// if err != nil {
// t.Fatal(err)
// }
// err = cli.createBucket(projectID, testBucket)
// if err != nil {
// t.Fatal(err)
// }
// defer func() {
// cli.deleteBucket(testBucket)
// }()

protocol := "gs://"

Expand Down Expand Up @@ -152,22 +152,22 @@ func TestGoogleStorage(t *testing.T) {
}
}

type gsTest struct {
client *gs.Client
}

func newGsTest() (*gsTest, error) {
client, err := gs.NewClient(context.Background())
return &gsTest{client}, err
}

func (g *gsTest) createBucket(projectID, bucket string) error {
cli := g.client.Bucket(bucket)
return cli.Create(context.Background(), projectID, nil)
}

func (g *gsTest) deleteBucket(bucket string) error {
// emptyBucket(g.bucket)
// g.Buckets.Delete(g.bucket)
return nil
}
// type gsTest struct {
// client *gs.Client
// }

// func newGsTest() (*gsTest, error) {
// client, err := gs.NewClient(context.Background())
// return &gsTest{client}, err
// }

// func (g *gsTest) createBucket(projectID, bucket string) error {
// cli := g.client.Bucket(bucket)
// return cli.Create(context.Background(), projectID, nil)
// }

// func (g *gsTest) deleteBucket(bucket string) error {
// // emptyBucket(g.bucket)
// // g.Buckets.Delete(g.bucket)
// return nil
// }

0 comments on commit 68feb28

Please sign in to comment.