Skip to content

Commit

Permalink
Fix prometheus test (#49)
Browse files Browse the repository at this point in the history
Co-authored-by: Arun Gopalpuri <[email protected]>
  • Loading branch information
arun0009 and Arun Gopalpuri authored Apr 6, 2021
1 parent 304bbdf commit 9d2f96a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions prometheus/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ func TestMetricsPushGateway(t *testing.T) {
p := NewPrometheus("echo", nil)
p.Use(e)

result := p.getMetrics()

assert.Contains(t, string(result), fmt.Sprintf("%s_request_duration", p.Subsystem))
g := gofight.New()
g.GET(p.MetricsPath).Run(e, func(r gofight.HTTPResponse, rq gofight.HTTPRequest) {
assert.Equal(t, http.StatusOK, r.Code)
assert.NotContains(t, r.Body.String(), fmt.Sprintf("%s_request_duration", p.Subsystem))
})
unregister(p)
}

0 comments on commit 9d2f96a

Please sign in to comment.