Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
Signed-off-by: Will Kutler <wkutler@redhat.com>
  • Loading branch information
willkutler committed Jan 18, 2023
1 parent 6258e87 commit 34d5efe
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions test/e2e/case28_evauluation_metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ var _ = Describe("Test config policy evaluation metrics", Ordered, func() {

prePolicyEvalDuration := -1

It("should record number of ", func() {
It("should record number of evaluations under 30 seconds for comparison", func() {
evalMetric := utils.GetMetrics(
"config_policies_evaluation_duration_seconds_bucket", fmt.Sprintf(`le=\"%d\"`, 30))
Expect(len(evalMetric) != 0)
Expect(len(evalMetric) != 0).To(BeTrue())
numEvals, err := strconv.Atoi(evalMetric[0])
Expect(err == nil)
Expect(err == nil).To(BeTrue())
prePolicyEvalDuration = numEvals
Expect(prePolicyEvalDuration > -1)
Expect(prePolicyEvalDuration > -1).To(BeTrue())
})

It("should create policy", func() {
Expand Down Expand Up @@ -102,12 +102,7 @@ var _ = Describe("Test config policy evaluation metrics", Ordered, func() {
opt := metav1.ListOptions{}
utils.ListWithTimeout(
clientManagedDynamic, gvrConfigPolicy, opt, 0, false, defaultTimeoutSeconds)
}

It("should clean up", cleanup)

It("should have no evaluation metrics for deleted policies after clean up", func() {
By("Checking evaluation metrics for deleted config policy")
Eventually(func() interface{} {
return utils.GetMetrics(
"config_policy_evaluation_total", fmt.Sprintf(`name=\"%s\"`, policyName))
Expand All @@ -116,7 +111,7 @@ var _ = Describe("Test config policy evaluation metrics", Ordered, func() {
return utils.GetMetrics(
"config_policy_evaluation_seconds_total", fmt.Sprintf(`name=\"%s\"`, policyName))
}, defaultTimeoutSeconds, 1).Should(Equal([]string{}))
})
}

AfterAll(cleanup)
})

0 comments on commit 34d5efe

Please sign in to comment.