Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #11265 to 7.0: Log Kibana GET /api/status response on test failure #11327

Merged
merged 1 commit into from
Mar 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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