skip procfs-dependent metrics test if not on linux

This commit is contained in:
Aaron Crickenberger 2017-05-02 13:33:55 -07:00
parent 7f2011c160
commit 276704ee22

View File

@ -21,6 +21,7 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"runtime"
"testing" "testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -85,6 +86,10 @@ func checkForExpectedMetrics(t *testing.T, metrics []*prometheuspb.MetricFamily,
} }
func TestMasterProcessMetrics(t *testing.T) { func TestMasterProcessMetrics(t *testing.T) {
if runtime.GOOS == "darwin" || runtime.GOOS == "windows" {
t.Skipf("not supported on GOOS=%s", runtime.GOOS)
}
_, s := framework.RunAMaster(nil) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
@ -95,7 +100,6 @@ func TestMasterProcessMetrics(t *testing.T) {
checkForExpectedMetrics(t, metrics, []string{ checkForExpectedMetrics(t, metrics, []string{
"process_start_time_seconds", "process_start_time_seconds",
"process_cpu_seconds_total", "process_cpu_seconds_total",
"go_goroutines",
"process_open_fds", "process_open_fds",
"process_resident_memory_bytes", "process_resident_memory_bytes",
}) })