From 34d5efed805dbf828dfeafcbb240e50d57b84eb5 Mon Sep 17 00:00:00 2001 From: Will Kutler Date: Wed, 18 Jan 2023 12:04:44 -0500 Subject: [PATCH] review Signed-off-by: Will Kutler --- test/e2e/case28_evauluation_metric_test.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/test/e2e/case28_evauluation_metric_test.go b/test/e2e/case28_evauluation_metric_test.go index db36086f..cc32f789 100644 --- a/test/e2e/case28_evauluation_metric_test.go +++ b/test/e2e/case28_evauluation_metric_test.go @@ -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() { @@ -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)) @@ -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) })