storagetesting: verify progress callbacks

This commit is contained in:
Jarek Kowalski
2018-10-27 12:07:54 -07:00
parent 0eded38776
commit 4237bbc42a
2 changed files with 7 additions and 1 deletions

View File

@@ -27,9 +27,13 @@ func VerifyStorage(ctx context.Context, t *testing.T, r storage.Storage) {
AssertGetBlockNotFound(ctx, t, r, b.blk)
}
ctx2 := storage.WithUploadProgressCallback(ctx, func(desc string, completed, total int64) {
log.Infof("progress %v: %v/%v", desc, completed, total)
})
// Now add blocks.
for _, b := range blocks {
if err := r.PutBlock(ctx, b.blk, b.contents); err != nil {
if err := r.PutBlock(ctx2, b.blk, b.contents); err != nil {
t.Errorf("can't put block: %v", err)
}

View File

@@ -34,4 +34,6 @@ func TestGCSStorage(t *testing.T) {
}
storagetesting.VerifyStorage(ctx, t, st)
storagetesting.AssertConnectionInfoRoundTrips(ctx, t, st)
}