| Index: appengine/logdog/coordinator/coordinatorTest/service.go
|
| diff --git a/appengine/logdog/coordinator/coordinatorTest/service.go b/appengine/logdog/coordinator/coordinatorTest/service.go
|
| index 6b37dffbf9373d0d49f8b6bb9ee910ec3279c1d7..a9d39c5789d79c2c9abf8a484140f8cb58d91af4 100644
|
| --- a/appengine/logdog/coordinator/coordinatorTest/service.go
|
| +++ b/appengine/logdog/coordinator/coordinatorTest/service.go
|
| @@ -7,7 +7,9 @@ package coordinatorTest
|
| import (
|
| "github.com/luci/luci-go/appengine/logdog/coordinator"
|
| "github.com/luci/luci-go/appengine/logdog/coordinator/config"
|
| + luciConfig "github.com/luci/luci-go/common/config"
|
| "github.com/luci/luci-go/common/gcloud/gs"
|
| + "github.com/luci/luci-go/common/proto/logdog/svcconfig"
|
| "github.com/luci/luci-go/server/logdog/storage"
|
| "golang.org/x/net/context"
|
| )
|
| @@ -19,6 +21,10 @@ type Services struct {
|
| // local static members.
|
| C func() (*config.Config, error)
|
|
|
| + // PC, if not nil, will be used to get the return values for ProjectConfig,
|
| + // overriding local static members.
|
| + PC func() (*svcconfig.ProjectConfig, error)
|
| +
|
| // Storage returns an intermediate storage instance for use by this service.
|
| //
|
| // The caller must close the returned instance if successful.
|
| @@ -38,13 +44,15 @@ func (s *Services) Config(c context.Context) (*config.Config, error) {
|
| if s.C != nil {
|
| return s.C()
|
| }
|
| + return config.Load(c)
|
| +}
|
|
|
| - gcfg, err := config.Load(c)
|
| - if err != nil {
|
| - return nil, err
|
| +// ProjectConfig implements coordinator.Services.
|
| +func (s *Services) ProjectConfig(c context.Context, project luciConfig.ProjectName) (*svcconfig.ProjectConfig, error) {
|
| + if s.PC != nil {
|
| + return s.PC()
|
| }
|
| -
|
| - return gcfg, nil
|
| + return config.ProjectConfig(c, project)
|
| }
|
|
|
| // IntermediateStorage implements coordinator.Services.
|
|
|