From 37e03e510fd31b6e9eb48d77e184db79959fd273 Mon Sep 17 00:00:00 2001 From: Jacob Baungard Hansen Date: Mon, 27 May 2024 11:08:44 +0200 Subject: [PATCH] Tests: Add basic test for dashboard existence A quick test that checks if the dashboards exists. Signed-off-by: Jacob Baungard Hansen --- .../pkg/tests/observability_dashboard_test.go | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/tests/pkg/tests/observability_dashboard_test.go b/tests/pkg/tests/observability_dashboard_test.go index a2ab147658..98b6f805db 100644 --- a/tests/pkg/tests/observability_dashboard_test.go +++ b/tests/pkg/tests/observability_dashboard_test.go @@ -13,9 +13,11 @@ import ( ) const ( - dashboardName = "sample-dashboard" - dashboardTitle = "Sample Dashboard for E2E" - updateDashboardTitle = "Update Sample Dashboard for E2E" + dashboardName = "sample-dashboard" + dashboardTitle = "Sample Dashboard for E2E" + updateDashboardTitle = "Update Sample Dashboard for E2E" + clusterOverviewTitle = "ACM - Clusters Overview" + clusterOverviewOptimizedTitle = "ACM - Clusters Overview (Optimized)" ) var _ = Describe("Observability:", func() { @@ -89,4 +91,30 @@ var _ = Describe("Observability:", func() { } testFailed = testFailed || CurrentGinkgoTestDescription().Failed }) + + + It("[P2][Sev2][observability][Stable] Should have default overview dashboards (dashboard/g0)", func() { + // Check Original dash exists + Eventually(func() bool { + _, result := utils.ContainDashboard(testOptions, clusterOverviewTitle) + return result + }, EventuallyTimeoutMinute*3, EventuallyIntervalSecond*5).Should(BeFalse()) + // Check optimized dash + Eventually(func() bool { + _, result := utils.ContainDashboard(testOptions, clusterOverviewOptimizedTitle) + return result + }, EventuallyTimeoutMinute*3, EventuallyIntervalSecond*5).Should(BeFalse()) + + }) + + JustAfterEach(func() { + Expect(utils.IntegrityChecking(testOptions)).NotTo(HaveOccurred()) + }) + + AfterEach(func() { + if CurrentGinkgoTestDescription().Failed { + utils.LogFailingTestStandardDebugInfo(testOptions) + } + testFailed = testFailed || CurrentGinkgoTestDescription().Failed + }) })