Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver006 committed May 8, 2019
1 parent 636d56a commit 7fca386
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions exporter/redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -935,8 +935,14 @@ func TestHTTPScrapeEndpoint(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(e.ScrapeHandler))
defer ts.Close()

u := fmt.Sprintf(ts.URL+"/?target=%s", os.Getenv("TEST_REDIS_URI"))
body := downloadURL(t, u)
v := url.Values{}
v.Add("target", os.Getenv("TEST_REDIS_URI"))
v.Add("check-single-keys", dbNumStrFull+"="+url.QueryEscape(keys[0]))

u, _ := url.Parse(ts.URL)
u.RawQuery = v.Encode()

body := downloadURL(t, u.String())

wants := []string{
// metrics
Expand All @@ -960,6 +966,9 @@ func TestHTTPScrapeEndpoint(t *testing.T) {
`standalone`,
`cmd="get"`,

`test_key_size{db="db11",key="` + keys[0] + `"} 7`,
`test_key_value{db="db11",key="` + keys[0] + `"} 1234.56`,

`test_db_keys{db="db11"} 11`,
`test_db_keys_expiring{db="db11"} `,
}
Expand Down

0 comments on commit 7fca386

Please sign in to comment.