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

Unified Diff: server/internal/logdog/archivist/archivist_test.go

Issue 1968063003: LogDog: Use per-project settings for archival. (Closed) Base URL: https://github.com/luci/luci-go@logdog-project-coordinator-useconfig
Patch Set: Created 4 years, 7 months 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: server/internal/logdog/archivist/archivist_test.go
diff --git a/server/internal/logdog/archivist/archivist_test.go b/server/internal/logdog/archivist/archivist_test.go
index bb07aeee34610ed05d568576b1406100a5045d61..8f97913c27399f5aedefeef90a01618648d8a316 100644
--- a/server/internal/logdog/archivist/archivist_test.go
+++ b/server/internal/logdog/archivist/archivist_test.go
@@ -297,16 +297,31 @@ func TestHandleArchive(t *testing.T) {
},
}
+ stBase := Settings{}
+
ar := Archivist{
- Service: &sc,
- Storage: &st,
- GSClient: &gsc,
- GSBase: gs.Path("gs://archive-test/path/to/archive/"), // Extra slashes to test concatenation.
- GSStagingBase: gs.Path("gs://archive-test-staging/path/to/archive/"), // Extra slashes to test concatenation.
+ Service: &sc,
+ SettingsLoader: func(c context.Context, proj config.ProjectName) (*Settings, error) {
+ if proj == "" {
+ proj = "_"
+ }
+
+ // Extra slashes to test concatenation,.
+ st := stBase
+ st.GSBase = gs.Path(fmt.Sprintf("gs://archival/%s/path/to/archive/", proj))
+ st.GSStagingBase = gs.Path(fmt.Sprintf("gs://archival-staging/%s/path/to/archive/", proj))
+ return &st, nil
+ },
+ Storage: &st,
+ GSClient: &gsc,
}
gsURL := func(project, name string) string {
- return fmt.Sprintf("gs://archive-test/path/to/archive/%s/%s/%s", project, desc.Path(), name)
+ if project == "" {
+ project = "_"
+ }
+
+ return fmt.Sprintf("gs://archival/%s/path/to/archive/%s/%s/%s", project, project, desc.Path(), name)
}
// hasStreams can be called to check that the retained archiveRequest had

Powered by Google App Engine
This is Rietveld 408576698