@@ -10,14 +10,17 @@ import (
1010 "testing"
1111 "time"
1212
13+ "cloud.google.com/go/storage"
1314 "github.com/googleapis/google-cloud-go-testing/storage/stiface"
14- "github.com/m-lab/go/logx"
1515 "golang.org/x/sync/errgroup"
1616 "google.golang.org/api/iterator"
1717
18- "cloud.google.com/go/storage"
1918 "github.com/m-lab/etl/active"
20- "github.com/m-lab/go/cloudtest"
19+ "github.com/m-lab/go/cloud/gcs"
20+ "github.com/m-lab/go/logx"
21+ "github.com/m-lab/go/rtx"
22+
23+ "github.com/m-lab/go/cloudtest/gcsfake"
2124)
2225
2326func init () {
@@ -77,23 +80,25 @@ func newCounter(t *testing.T) *counter {
7780}
7881
7982func testClient () stiface.Client {
80- client := cloudtest .GCSClient {}
83+ client := gcsfake .GCSClient {}
8184 client .AddTestBucket ("foobar" ,
82- cloudtest .BucketHandle {
85+ gcsfake .BucketHandle {
8386 ObjAttrs : []* storage.ObjectAttrs {
84- & storage. ObjectAttrs {Bucket : "foobar" , Name : "ndt/ndt5/2019/01/01/obj1" , Updated : time .Now ()},
85- & storage. ObjectAttrs {Bucket : "foobar" , Name : "ndt/ndt5/2019/01/01/obj2" , Updated : time .Now ()},
86- & storage. ObjectAttrs {Bucket : "foobar" , Name : "ndt/ndt5/2019/01/01/obj3" , Updated : time .Date (2000 , 01 , 01 , 02 , 03 , 04 , 0 , time .UTC )},
87- & storage. ObjectAttrs {Bucket : "foobar" , Name : "ndt/ndt5/2019/01/01/subdir/obj4" , Updated : time .Now ()},
88- & storage. ObjectAttrs {Bucket : "foobar" , Name : "ndt/ndt5/2019/01/01/subdir/obj5" , Updated : time .Now ()},
89- & storage. ObjectAttrs {Bucket : "foobar" , Name : "ndt/tcpinfo/2019/01/01/obj3" , Updated : time .Date (2000 , 01 , 01 , 02 , 03 , 04 , 0 , time .UTC )},
90- & storage. ObjectAttrs {Bucket : "foobar" , Name : "obj6" , Updated : time .Now ()},
87+ {Bucket : "foobar" , Name : "ndt/ndt5/2019/01/01/obj1" , Updated : time .Now ()},
88+ {Bucket : "foobar" , Name : "ndt/ndt5/2019/01/01/obj2" , Updated : time .Now ()},
89+ {Bucket : "foobar" , Name : "ndt/ndt5/2019/01/01/obj3" , Updated : time .Date (2000 , 01 , 01 , 02 , 03 , 04 , 0 , time .UTC )},
90+ {Bucket : "foobar" , Name : "ndt/ndt5/2019/01/01/subdir/obj4" , Updated : time .Now ()},
91+ {Bucket : "foobar" , Name : "ndt/ndt5/2019/01/01/subdir/obj5" , Updated : time .Now ()},
92+ {Bucket : "foobar" , Name : "ndt/tcpinfo/2019/01/01/obj3" , Updated : time .Date (2000 , 01 , 01 , 02 , 03 , 04 , 0 , time .UTC )},
93+ {Bucket : "foobar" , Name : "obj6" , Updated : time .Now ()},
9194 }})
9295 return client
9396}
9497
9598func standardLister () active.FileLister {
96- return active .FileListerFunc (testClient (), "gs://foobar/ndt/ndt5/2019/01/01/" , nil )
99+ bh , err := gcs .GetBucket (context .Background (), testClient (), "foobar" )
100+ rtx .Must (err , "GetBucket failed" )
101+ return active .FileListerFunc (bh , "ndt/ndt5/2019/01/01/" , nil )
97102}
98103
99104func runAll (ctx context.Context , rSrc active.RunnableSource ) (* errgroup.Group , error ) {
0 commit comments