Skip to content

Commit

Permalink
server: fixup tests
Browse files Browse the repository at this point in the history
Signed-off-by: scbizu <[email protected]>
  • Loading branch information
scbizu committed Sep 21, 2024
1 parent 2b69eb8 commit c60057c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/chartmuseum/server/multitenant/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -971,13 +971,16 @@ func (suite *MultiTenantServerTestSuite) TestMaxUploadSizeServer() {
}

func (suite *MultiTenantServerTestSuite) TestMetrics() {
res := suite.doRequest("depth1", "GET", "bad-url", nil, "")
suite.Equal(404, res.Status(), "404 GET bad-url")

apiPrefix := pathutil.Join("/api", "a")

content, err := os.ReadFile(testTarballPath)
suite.Nil(err, "error opening test tarball")

body := bytes.NewBuffer(content)
res := suite.doRequest("depth1", "POST", fmt.Sprintf("%s/charts", apiPrefix), body, "")
res = suite.doRequest("depth1", "POST", fmt.Sprintf("%s/charts", apiPrefix), body, "")
suite.Equal(201, res.Status(), fmt.Sprintf("201 post %s/charts", apiPrefix))

otherChart, err := os.ReadFile(testTarballPathV2)
Expand All @@ -995,9 +998,6 @@ func (suite *MultiTenantServerTestSuite) TestMetrics() {
res = suite.doRequest("depth1", "GET", "/b/index.yaml", nil, "")
suite.Equal(200, res.Status(), "200 GET /b/index.yaml")

res = suite.doRequest("depth1", "GET", "/bad-url", nil, "")
suite.Equal(404, res.Status(), "404 GET /bad-url")

var buffer *bytes.Buffer
var metrics string

Expand Down

0 comments on commit c60057c

Please sign in to comment.