Skip to content

Commit

Permalink
Move first metric check to BeforeEach()
Browse files Browse the repository at this point in the history
Signed-off-by: Josef Karasek <jkarasek@redhat.com>
  • Loading branch information
Josef Karasek committed Jul 12, 2021
1 parent d881085 commit fc58998
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/e2e/metrics_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,18 @@ var _ = Describe("Metrics are generated for OLM managed resources", func() {

_, err = fetchCSV(crc, csv.Name, testNamespace, csvSucceededChecker)
Expect(err).ToNot(HaveOccurred())

Expect(getMetricsFromPod(c, getPodWithLabel(c, "app=olm-operator"), "8081")).To(
ContainElement(LikeMetric(WithFamily("csv_succeeded"), WithName(csv.Name), WithValue(1))),
)
})
AfterEach(func() {
if cleanupCSV != nil {
cleanupCSV()
}
})
It("csv metric is preserved", func() {
Expect(getMetricsFromPod(c, getPodWithLabel(c, "app=olm-operator"), "8081")).To(
ContainElement(LikeMetric(WithFamily("csv_succeeded"), WithName(csv.Name), WithValue(1))),
)

restartDeploymentWithLabel(c, "app=olm-operator")

Expect(getMetricsFromPod(c, getPodWithLabel(c, "app=olm-operator"), "8081")).To(
ContainElement(LikeMetric(WithFamily("csv_succeeded"), WithName(csv.Name), WithValue(1))),
)
Expand Down

0 comments on commit fc58998

Please sign in to comment.