Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Unified Diff: logdog/common/storage/archive/storage_test.go

Issue 2538203002: LogDog: Add signed GS URL fetching. (Closed)
Patch Set: Allow index signing, use gaesigner. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: logdog/common/storage/archive/storage_test.go
diff --git a/logdog/common/storage/archive/storage_test.go b/logdog/common/storage/archive/storage_test.go
index 170646090d9cd367a2330dbe2d2ef21df0f33eb7..f278a45b88cb32ca9f7994bc4701c3f23295ecda 100644
--- a/logdog/common/storage/archive/storage_test.go
+++ b/logdog/common/storage/archive/storage_test.go
@@ -28,8 +28,8 @@ import (
)
const (
- testIndexURL = "gs://+/index"
- testStreamURL = "gs://+/stream"
+ testIndexPath = gs.Path("gs://+/index")
+ testStreamPath = gs.Path("gs://+/stream")
)
type logStreamGenerator struct {
@@ -181,10 +181,10 @@ func (c *fakeGSClient) NewReader(p gs.Path, offset, length int64) (io.ReadCloser
data []byte
readerErr error
)
- switch string(p) {
- case testIndexURL:
+ switch p {
+ case testIndexPath:
data, readerErr = c.index, c.indexErr
- case testStreamURL:
+ case testStreamPath:
data, readerErr = c.stream, c.streamErr
default:
return nil, cloudStorage.ErrObjectNotExist
@@ -218,9 +218,9 @@ func TestArchiveStorage(t *testing.T) {
defer client.Close()
opts := Options{
- IndexURL: testIndexURL,
- StreamURL: testStreamURL,
- Client: &client,
+ Index: testIndexPath,
+ Stream: testStreamPath,
+ Client: &client,
}
st, err := New(c, opts)
So(err, ShouldBeNil)
@@ -246,8 +246,8 @@ func TestArchiveStorage(t *testing.T) {
}{
{`Complete index`, func() {}},
{`Empty index protobuf`, func() { gen.sparseIndex() }},
- {`No index provided`, func() { stImpl.indexPath = "" }},
- {`Invalid index path`, func() { stImpl.indexPath = "does-not-exist" }},
+ {`No index provided`, func() { stImpl.Index = "" }},
+ {`Invalid index path`, func() { stImpl.Index = "does-not-exist" }},
{`Sparse index with a start and terminal entry`, func() { gen.sparseIndex(0, 2, 4) }},
{`Sparse index with a terminal entry`, func() { gen.sparseIndex(1, 3, 4) }},
{`Sparse index missing a terminal entry`, func() { gen.sparseIndex(1, 3) }},
@@ -322,7 +322,7 @@ func TestArchiveStorage(t *testing.T) {
} {
Convey(fmt.Sprintf("Testing retrieval: %q", tc.title), func() {
Convey(`With missing log stream returns ErrDoesNotExist.`, func() {
- stImpl.streamPath = "does-not-exist"
+ stImpl.Stream = "does-not-exist"
So(st.Get(storage.GetRequest{}, nil), ShouldEqual, storage.ErrDoesNotExist)
})

Powered by Google App Engine
This is Rietveld 408576698