From 254aab13a4678346bcb74fb0c248bf5ed7e0def6 Mon Sep 17 00:00:00 2001 From: Jacob Baungard Hansen Date: Mon, 2 Dec 2024 10:51:59 +0100 Subject: [PATCH] Dummy OCP-required test To see if this work fine. Signed-off-by: Jacob Baungard Hansen --- .../pkg/tests/observability_dummy_ocp_test.go | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 tests/pkg/tests/observability_dummy_ocp_test.go diff --git a/tests/pkg/tests/observability_dummy_ocp_test.go b/tests/pkg/tests/observability_dummy_ocp_test.go new file mode 100644 index 000000000..1bec9318e --- /dev/null +++ b/tests/pkg/tests/observability_dummy_ocp_test.go @@ -0,0 +1,58 @@ +// Copyright (c) Red Hat, Inc. +// Copyright Contributors to the Open Cluster Management project +// Licensed under the Apache License 2.0 + +package tests + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + "github.com/stolostron/multicluster-observability-operator/tests/pkg/utils" +) + +var _ = Describe("Observability:", func() { + BeforeEach(func() { + hubClient = utils.NewKubeClient( + testOptions.HubCluster.ClusterServerURL, + testOptions.KubeConfig, + testOptions.HubCluster.KubeContext) + + dynClient = utils.NewKubeClientDynamic( + testOptions.HubCluster.ClusterServerURL, + testOptions.KubeConfig, + testOptions.HubCluster.KubeContext) + }) + + JustBeforeEach(func() { + Eventually(func() error { + clusters, clusterError = utils.ListManagedClusters(testOptions) + if clusterError != nil { + return clusterError + } + return nil + }, EventuallyTimeoutMinute*6, EventuallyIntervalSecond*5).Should(Succeed()) + }) + + It("[P2][Sev2][observability][Integration] DUMMY OCP TEST (requires-ocp/g0 manifestwork/g0)", func() { + By("Checking Required CRDs are created") + Eventually(func() error { + return utils.HaveCRDs(testOptions.HubCluster, testOptions.KubeConfig, + []string{ + "consoles.config.openshift.io", + }) + }).Should(Succeed()) + }) + + JustAfterEach(func() { + if CurrentGinkgoTestDescription().Failed { + utils.LogFailingTestStandardDebugInfo(testOptions) + } + testFailed = testFailed || CurrentGinkgoTestDescription().Failed + }) + + AfterEach(func() { + Expect(utils.CleanExportResources(testOptions)).NotTo(HaveOccurred()) + Expect(utils.IntegrityChecking(testOptions)).NotTo(HaveOccurred()) + }) +})