From b3bc7c47f5e9bcff9ac839b7662e6168b2536581 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Tue, 7 Mar 2023 16:21:49 +0100 Subject: [PATCH] Skip DevfileRegistriesList-related tests on non Kubernetes clusters (#6640) On Prow, users might not have the permission to install the CRDs. It is actually fine to execute these tests only on Kubernetes. --- tests/integration/cmd_devfile_init_test.go | 3 +++ tests/integration/cmd_devfile_registry_test.go | 3 +++ tests/integration/cmd_pref_config_test.go | 3 +++ tests/integration/interactive_init_test.go | 3 +++ 4 files changed, 12 insertions(+) diff --git a/tests/integration/cmd_devfile_init_test.go b/tests/integration/cmd_devfile_init_test.go index b9ed584e09e..4ba8200e7f6 100644 --- a/tests/integration/cmd_devfile_init_test.go +++ b/tests/integration/cmd_devfile_init_test.go @@ -579,6 +579,9 @@ var _ = Describe("odo devfile init command tests", func() { When("DevfileRegistriesList CRD is installed on cluster", func() { BeforeEach(func() { + if !helper.IsKubernetesCluster() { + Skip("skipped on non Kubernetes clusters") + } devfileRegistriesLists := commonVar.CliRunner.Run("apply", "-f", helper.GetExamplePath("manifests", "devfileregistrieslists.yaml")) Expect(devfileRegistriesLists.ExitCode()).To(BeEquivalentTo(0)) }) diff --git a/tests/integration/cmd_devfile_registry_test.go b/tests/integration/cmd_devfile_registry_test.go index 012fb1fb04f..83727fdd488 100644 --- a/tests/integration/cmd_devfile_registry_test.go +++ b/tests/integration/cmd_devfile_registry_test.go @@ -206,6 +206,9 @@ var _ = Describe("odo devfile registry command tests", func() { When("DevfileRegistriesList CRD is installed on cluster", func() { BeforeEach(func() { + if !helper.IsKubernetesCluster() { + Skip("skipped on non Kubernetes clusters") + } // install CRDs for devfile registry devfileRegistriesLists := commonVar.CliRunner.Run("apply", "-f", helper.GetExamplePath("manifests", "devfileregistrieslists.yaml")) Expect(devfileRegistriesLists.ExitCode()).To(BeEquivalentTo(0)) diff --git a/tests/integration/cmd_pref_config_test.go b/tests/integration/cmd_pref_config_test.go index a0ed78551da..1072ba5ae9f 100644 --- a/tests/integration/cmd_pref_config_test.go +++ b/tests/integration/cmd_pref_config_test.go @@ -204,6 +204,9 @@ OdoSettings: } When("DevfileRegistriesList CRD is installed on cluster", func() { BeforeEach(func() { + if !helper.IsKubernetesCluster() { + Skip("skipped on non Kubernetes clusters") + } // install CRDs for devfile registry //TODO: install clusterRegestryList from scripts // clusterRegistryList := commonVar.CliRunner.Run("apply", "-f", helper.GetExamplePath("manifests", "clusterdevfileregistrieslists.yaml")) diff --git a/tests/integration/interactive_init_test.go b/tests/integration/interactive_init_test.go index 8103695a5d7..89bf2f394cc 100644 --- a/tests/integration/interactive_init_test.go +++ b/tests/integration/interactive_init_test.go @@ -569,6 +569,9 @@ var _ = Describe("odo init interactive command tests", func() { When("DevfileRegistriesList CRD is installed on cluster", func() { BeforeEach(func() { + if !helper.IsKubernetesCluster() { + Skip("skipped on non Kubernetes clusters") + } devfileRegistriesLists := commonVar.CliRunner.Run("apply", "-f", helper.GetExamplePath("manifests", "devfileregistrieslists.yaml")) Expect(devfileRegistriesLists.ExitCode()).To(BeEquivalentTo(0)) })