X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/5d68da382b77745e69640dfdd4e4bd9110e72f4a..eb0b1549382d941503b6a5d205250e50c7ab473d:/services/keep-web/server_test.go diff --git a/services/keep-web/server_test.go b/services/keep-web/server_test.go index 7391ffb554..ad69439509 100644 --- a/services/keep-web/server_test.go +++ b/services/keep-web/server_test.go @@ -5,6 +5,7 @@ package main import ( + "bytes" "crypto/md5" "encoding/json" "fmt" @@ -21,6 +22,7 @@ import ( "git.curoverse.com/arvados.git/sdk/go/arvados" "git.curoverse.com/arvados.git/sdk/go/arvadosclient" "git.curoverse.com/arvados.git/sdk/go/arvadostest" + "git.curoverse.com/arvados.git/sdk/go/ctxlog" "git.curoverse.com/arvados.git/sdk/go/keepclient" check "gopkg.in/check.v1" ) @@ -299,6 +301,7 @@ func (s *IntegrationSuite) runCurl(c *check.C, token, host, uri string, args ... } func (s *IntegrationSuite) TestMetrics(c *check.C) { + s.testServer.Config.cluster.Services.WebDAVDownload.ExternalURL.Host = s.testServer.Addr origin := "http://" + s.testServer.Addr req, _ := http.NewRequest("GET", origin+"/notfound", nil) _, err := http.DefaultClient.Do(req) @@ -339,12 +342,8 @@ func (s *IntegrationSuite) TestMetrics(c *check.C) { c.Assert(err, check.IsNil) c.Check(resp.StatusCode, check.Equals, http.StatusOK) type summary struct { - SampleCount string `json:"sample_count"` - SampleSum float64 `json:"sample_sum"` - Quantile []struct { - Quantile float64 - Value float64 - } + SampleCount string + SampleSum float64 } type counter struct { Value int64 @@ -427,9 +426,11 @@ func (s *IntegrationSuite) TearDownSuite(c *check.C) { func (s *IntegrationSuite) SetUpTest(c *check.C) { arvadostest.ResetEnv() - ldr := config.NewLoader(nil, nil) - arvCfg, err := ldr.LoadDefaults() - cfg := DefaultConfig(arvCfg) + ldr := config.NewLoader(bytes.NewBufferString("Clusters: {zzzzz: {}}"), ctxlog.TestLogger(c)) + ldr.Path = "-" + arvCfg, err := ldr.Load() + c.Check(err, check.IsNil) + cfg := newConfig(arvCfg) c.Assert(err, check.IsNil) cfg.Client = arvados.Client{ APIHost: testAPIHost, @@ -439,6 +440,7 @@ func (s *IntegrationSuite) SetUpTest(c *check.C) { cfg.cluster.Services.WebDAV.InternalURLs[arvados.URL{Host: listen}] = arvados.ServiceInstance{} cfg.cluster.Services.WebDAVDownload.InternalURLs[arvados.URL{Host: listen}] = arvados.ServiceInstance{} cfg.cluster.ManagementToken = arvadostest.ManagementToken + cfg.cluster.Users.AnonymousUserToken = arvadostest.AnonymousToken s.testServer = &server{Config: cfg} err = s.testServer.Start() c.Assert(err, check.Equals, nil)