diff --git a/src/main/java/io/odh/test/TestSuite.java b/src/main/java/io/odh/test/TestSuite.java new file mode 100644 index 00000000..f40366c1 --- /dev/null +++ b/src/main/java/io/odh/test/TestSuite.java @@ -0,0 +1,16 @@ +/* + * Copyright Skodjob authors. + * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). + */ +package io.odh.test; + +public class TestSuite { + public static final String SMOKE = "smoke"; + public static final String UPGRADE = "upgrade"; + public static final String STANDARD = "standard"; + public static final String CONTINUOUS = "continuous"; + public static final String UNIT = "unit"; + + private TestSuite() { + } +} diff --git a/src/test/java/io/odh/test/e2e/Abstract.java b/src/test/java/io/odh/test/e2e/Abstract.java index e3b4832b..105b2aeb 100644 --- a/src/test/java/io/odh/test/e2e/Abstract.java +++ b/src/test/java/io/odh/test/e2e/Abstract.java @@ -14,7 +14,7 @@ @ExtendWith(TestExceptionCallbackListener.class) @ExtendWith(ResourceManagerContextHandler.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) -public class Abstract implements TestVisualSeparator { +public abstract class Abstract implements TestVisualSeparator { static { ResourceManager.getInstance(); diff --git a/src/test/java/io/odh/test/e2e/continuous/DataScienceClusterST.java b/src/test/java/io/odh/test/e2e/continuous/DataScienceClusterST.java index f3f4bb13..31b6d475 100644 --- a/src/test/java/io/odh/test/e2e/continuous/DataScienceClusterST.java +++ b/src/test/java/io/odh/test/e2e/continuous/DataScienceClusterST.java @@ -8,6 +8,7 @@ import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; import io.odh.test.OdhConstants; +import io.odh.test.TestSuite; import io.odh.test.e2e.Abstract; import io.odh.test.framework.manager.ResourceManager; import io.odh.test.framework.manager.resources.DataScienceClusterResource; @@ -31,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -@Tag("continuous") +@Tag(TestSuite.CONTINUOUS) public class DataScienceClusterST extends Abstract { private static final String DS_CLUSTER_NAME = "default"; diff --git a/src/test/java/io/odh/test/e2e/continuous/DataScienceProjectST.java b/src/test/java/io/odh/test/e2e/continuous/DataScienceProjectST.java index 0016fdc1..c4651dc5 100644 --- a/src/test/java/io/odh/test/e2e/continuous/DataScienceProjectST.java +++ b/src/test/java/io/odh/test/e2e/continuous/DataScienceProjectST.java @@ -7,6 +7,7 @@ import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; +import io.odh.test.TestSuite; import io.odh.test.e2e.Abstract; import io.odh.test.framework.manager.ResourceManager; import io.odh.test.framework.manager.resources.NotebookResource; @@ -25,7 +26,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -@Tag("continuous") +@Tag(TestSuite.CONTINUOUS) public class DataScienceProjectST extends Abstract { static final Logger LOGGER = LoggerFactory.getLogger(DataScienceProjectST.class); diff --git a/src/test/java/io/odh/test/e2e/standard/DataScienceClusterST.java b/src/test/java/io/odh/test/e2e/standard/DataScienceClusterST.java index 296e51a6..218dcf3e 100644 --- a/src/test/java/io/odh/test/e2e/standard/DataScienceClusterST.java +++ b/src/test/java/io/odh/test/e2e/standard/DataScienceClusterST.java @@ -4,6 +4,7 @@ */ package io.odh.test.e2e.standard; +import io.odh.test.TestSuite; import io.odh.test.framework.manager.ResourceManager; import io.odh.test.framework.manager.resources.DataScienceClusterResource; import io.opendatahub.datasciencecluster.v1.DataScienceCluster; @@ -24,7 +25,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -@Tag("smoke") +@Tag(TestSuite.SMOKE) public class DataScienceClusterST extends StandardAbstract { private static final String DS_PROJECT_NAME = "test-dsp"; diff --git a/src/test/java/io/odh/test/e2e/standard/StandardAbstract.java b/src/test/java/io/odh/test/e2e/standard/StandardAbstract.java index 6cb97c39..ae0be3bc 100644 --- a/src/test/java/io/odh/test/e2e/standard/StandardAbstract.java +++ b/src/test/java/io/odh/test/e2e/standard/StandardAbstract.java @@ -5,6 +5,7 @@ package io.odh.test.e2e.standard; import io.odh.test.Environment; +import io.odh.test.TestSuite; import io.odh.test.e2e.Abstract; import io.odh.test.framework.listeners.OdhResourceCleaner; import io.odh.test.framework.listeners.ResourceManagerDeleteHandler; @@ -24,10 +25,10 @@ import static org.junit.jupiter.api.Assertions.fail; -@Tag("standard") +@Tag(TestSuite.STANDARD) @ExtendWith(OdhResourceCleaner.class) @ExtendWith(ResourceManagerDeleteHandler.class) -public class StandardAbstract extends Abstract { +public abstract class StandardAbstract extends Abstract { private static final Logger LOGGER = LoggerFactory.getLogger(StandardAbstract.class); diff --git a/src/test/java/io/odh/test/e2e/upgrade/BundleUpgradeST.java b/src/test/java/io/odh/test/e2e/upgrade/BundleUpgradeST.java index 0d2531c0..89ba6a78 100644 --- a/src/test/java/io/odh/test/e2e/upgrade/BundleUpgradeST.java +++ b/src/test/java/io/odh/test/e2e/upgrade/BundleUpgradeST.java @@ -14,7 +14,6 @@ import io.odh.test.utils.PodUtils; import io.odh.test.utils.UpgradeUtils; import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -22,7 +21,6 @@ import java.io.IOException; import java.util.Map; -@Tag("upgrade") public class BundleUpgradeST extends UpgradeAbstract { private static final Logger LOGGER = LoggerFactory.getLogger(BundleUpgradeST.class); diff --git a/src/test/java/io/odh/test/e2e/upgrade/OlmUpgradeST.java b/src/test/java/io/odh/test/e2e/upgrade/OlmUpgradeST.java index d168e427..8ee9de4c 100644 --- a/src/test/java/io/odh/test/e2e/upgrade/OlmUpgradeST.java +++ b/src/test/java/io/odh/test/e2e/upgrade/OlmUpgradeST.java @@ -16,7 +16,6 @@ import io.odh.test.utils.PodUtils; import io.odh.test.utils.UpgradeUtils; import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,7 +23,6 @@ import java.io.IOException; import java.util.Map; -@Tag("upgrade") public class OlmUpgradeST extends UpgradeAbstract { private static final Logger LOGGER = LoggerFactory.getLogger(OlmUpgradeST.class); diff --git a/src/test/java/io/odh/test/e2e/upgrade/UpgradeAbstract.java b/src/test/java/io/odh/test/e2e/upgrade/UpgradeAbstract.java index db043e99..e4e5c10c 100644 --- a/src/test/java/io/odh/test/e2e/upgrade/UpgradeAbstract.java +++ b/src/test/java/io/odh/test/e2e/upgrade/UpgradeAbstract.java @@ -11,6 +11,7 @@ import io.fabric8.kubernetes.api.model.Quantity; import io.odh.test.Environment; import io.odh.test.OdhAnnotationsLabels; +import io.odh.test.TestSuite; import io.odh.test.e2e.Abstract; import io.odh.test.framework.listeners.OdhResourceCleaner; import io.odh.test.framework.listeners.ResourceManagerDeleteHandler; @@ -31,6 +32,7 @@ import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.ModelmeshservingBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Workbenches; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.WorkbenchesBuilder; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.extension.ExtendWith; import org.kubeflow.v1.Notebook; import org.kubeflow.v1.NotebookBuilder; @@ -38,9 +40,10 @@ import java.io.IOException; +@Tag(TestSuite.UPGRADE) @ExtendWith(OdhResourceCleaner.class) @ExtendWith(ResourceManagerDeleteHandler.class) -public class UpgradeAbstract extends Abstract { +public abstract class UpgradeAbstract extends Abstract { protected void deployDsc(String name) { // Deploy DSC diff --git a/src/test/java/io/odh/test/unit/UnitTests.java b/src/test/java/io/odh/test/unit/UnitTests.java index 686b3b0f..edb7ba06 100644 --- a/src/test/java/io/odh/test/unit/UnitTests.java +++ b/src/test/java/io/odh/test/unit/UnitTests.java @@ -10,6 +10,7 @@ import io.fabric8.kubernetes.client.dsl.Resource; import io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient; import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer; +import io.odh.test.TestSuite; import io.odh.test.framework.ExtensionContextParameterResolver; import io.odh.test.framework.listeners.TestVisualSeparator; import io.opendatahub.datasciencecluster.v1.DataScienceCluster; @@ -27,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; -@Tag("unit") +@Tag(TestSuite.UNIT) @ExtendWith(ExtensionContextParameterResolver.class) @EnableKubernetesMockClient(crud = true) public class UnitTests implements TestVisualSeparator {