Skip to content

Commit

Permalink
Simplify tests
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Wall <richard.wall@venafi.com>
  • Loading branch information
wallrj committed Jun 28, 2024
1 parent 3f82ded commit 7e0684c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/e2e/suite/cases/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package cases

import (
"context"
"strings"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down Expand Up @@ -49,10 +50,12 @@ var _ = framework.CasesDescribe("Metrics", func() {
ProxyGet("http", p.Name, "9402", "/metrics", map[string]string{}).
DoRaw(context.TODO())
Expect(err).NotTo(HaveOccurred())
resp := string(respBytes)
Expect(resp).To(ContainSubstring("# HELP go_threads Number of OS threads created."),
resp := strings.Split(string(respBytes), "\n")
Expect(resp).To(ContainElement(`# TYPE go_threads gauge`),
"go_collector metrics should be available")
Expect(resp).To(ContainSubstring("# HELP process_open_fds Number of open file descriptors."),
Expect(resp).To(ContainElement(`# TYPE process_open_fds gauge`),
"process_collector metrics should be available")
Expect(resp).To(ContainElement(`# TYPE rest_client_requests_total counter`),
"controller-runtime metrics should be available")
})
})

0 comments on commit 7e0684c

Please sign in to comment.