Skip to content

Commit

Permalink
Log Kibana GET /api/status response on test failure (#11265)
Browse files Browse the repository at this point in the history
To help debug #11261.
  • Loading branch information
ycombinator authored Mar 15, 2019
1 parent 9fb274a commit 67ebca4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions metricbeat/module/kibana/stats/stats_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestFetch(t *testing.T) {

config := mtest.GetConfig("stats")
host := config["hosts"].([]string)[0]
version, err := getKibanaVersion(host)
version, err := getKibanaVersion(t, host)
if err != nil {
t.Fatal("getting kibana version", err)
}
Expand Down Expand Up @@ -71,7 +71,7 @@ func TestData(t *testing.T) {

config := mtest.GetConfig("stats")
host := config["hosts"].([]string)[0]
version, err := getKibanaVersion(host)
version, err := getKibanaVersion(t, host)
if err != nil {
t.Fatal("getting kibana version", err)
}
Expand All @@ -92,7 +92,7 @@ func TestData(t *testing.T) {
}
}

func getKibanaVersion(kibanaHostPort string) (*common.Version, error) {
func getKibanaVersion(t *testing.T, kibanaHostPort string) (*common.Version, error) {
resp, err := http.Get("http://" + kibanaHostPort + "/api/status")
if err != nil {
return nil, err
Expand All @@ -112,6 +112,7 @@ func getKibanaVersion(kibanaHostPort string) (*common.Version, error) {

version, err := data.GetValue("version.number")
if err != nil {
t.Log("Kibana GET /api/status response:", string(body))
return nil, err
}

Expand Down

0 comments on commit 67ebca4

Please sign in to comment.