Skip to content

Commit

Permalink
Fix e2e json response
Browse files Browse the repository at this point in the history
  • Loading branch information
lescactus committed Nov 5, 2024
1 parent 5709fbd commit ea1820c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .e2e/gotest/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestE2E(t *testing.T) {
name: "valid path - " + *baseUrl + "/rest/v1/2.2.2.2",
url: "" + *baseUrl + "/rest/v1/2.2.2.2",
method: "GET",
want: []byte(`{"ip":"2.2.2.2","country_code":"FR","country_name":"France","city":"Paris","latitude":48.8566,"longitude":2.35222}`),
want: []byte(`{"ip":"2.2.2.2","country_code":"FR","country_name":"France","city":"Issy-les-Moulineaux","latitude":48.8309,"longitude":2.26582}`),
code: http.StatusOK,
},
{
Expand Down
6 changes: 3 additions & 3 deletions .e2e/gotest/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func parseMF(r io.Reader) (map[string]*dto.MetricFamily, error) {
func populateMetrics() error {
requests := []struct {
ip string
}{{ip: "1.1.1.1"},{ip: "2.2.2.2"},{ip: "3.3.3.3"},{ip: "4.4.4.4"},{ip: "5.5.5.5"},{ip: "6.6.6.6"},}
}{{ip: "1.1.1.1"}, {ip: "2.2.2.2"}, {ip: "3.3.3.3"}, {ip: "4.4.4.4"}, {ip: "5.5.5.5"}, {ip: "6.6.6.6"}}

client := &http.Client{Timeout: 5 * time.Second}

Expand All @@ -48,7 +48,7 @@ func populateMetrics() error {
func TestWithMetricsEnabled(t *testing.T) {
err := populateMetrics()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

client := &http.Client{Timeout: 5 * time.Second}
Expand Down Expand Up @@ -77,7 +77,7 @@ func TestWithMetricsEnabled(t *testing.T) {
data = append(data, '\n')
mf, err := parseMF(bytes.NewReader(data))
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
assert.NoError(t, err)

Expand Down

0 comments on commit ea1820c

Please sign in to comment.