Skip to content

Commit

Permalink
Merge pull request kubernetes#45242 from spiffxp/skip-metrics-procfs-…
Browse files Browse the repository at this point in the history
…test

Automatic merge from submit-queue (batch tested with PRs 45125, 45242)

skip procfs-dependent metrics test if not on linux

**What this PR does / why we need it**: kubernetes#40774 removed build tags on integration tests, which uncovered the fact that a test in `test/integration/metrics` relies on `procfs`. This PR follows the convention used in `pkg/util/procfs` to gate the test on `runtime.GOOS`

**Release note**:
```release-note
NONE
```

/cc @kubernetes/sig-testing-pr-reviews
  • Loading branch information
Kubernetes Submit Queue authored May 2, 2017
2 parents 52a18e9 + 276704e commit cf6c279
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/integration/metrics/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"net/http"
"net/http/httptest"
"runtime"
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -85,6 +86,10 @@ func checkForExpectedMetrics(t *testing.T, metrics []*prometheuspb.MetricFamily,
}

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)
defer s.Close()

Expand All @@ -95,7 +100,6 @@ func TestMasterProcessMetrics(t *testing.T) {
checkForExpectedMetrics(t, metrics, []string{
"process_start_time_seconds",
"process_cpu_seconds_total",
"go_goroutines",
"process_open_fds",
"process_resident_memory_bytes",
})
Expand Down

0 comments on commit cf6c279

Please sign in to comment.