diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a596024a..9eebdc29 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -26,6 +26,4 @@ jobs: ${{ runner.os }}-maven- - name: Validate with Maven - env: - MAVEN_OPTS: "-Xmx6144m" - run: mvn install \ No newline at end of file + run: mvn test \ No newline at end of file diff --git a/.mvn/maven.config b/.mvn/maven.config new file mode 100644 index 00000000..31c89300 --- /dev/null +++ b/.mvn/maven.config @@ -0,0 +1 @@ +--no-transfer-progress \ No newline at end of file diff --git a/pom.xml b/pom.xml index 0c0513e6..b636fed2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,17 +4,20 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - io.opendatahub + io.odh odh-e2e 1.0-SNAPSHOT + true 17 17 UTF-8 6.9.2 - 0.101.3 - 1.18.30 + 3.11.0 + 5.8.2 + 1.8.2 + 3.2.2 @@ -34,51 +37,77 @@ ${fabric8.version} - io.sundr - builder-annotations - ${sundrio.version} - provided + io.fabric8 + kubernetes-server-mock + ${fabric8.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit.jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-api + ${junit.jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit.jupiter.version} + test + + + org.junit.platform + junit-platform-commons + ${junit.platform.version} + + + org.junit.platform + junit-platform-launcher + ${junit.platform.version} + + + org.junit.platform + junit-platform-engine + ${junit.platform.version} - org.projectlombok - lombok - ${lobbok.version} - provided + org.apache.maven.plugins + maven-failsafe-plugin + ${maven.surefire.version} + test - io.fabric8 - java-generator-maven-plugin - ${fabric8.version} + org.apache.maven.plugins + maven-failsafe-plugin + ${maven.surefire.version} - generate-sources - generate + verify + integration-test - - src/main/resources/crds/odh-manifests-data-science-pipelines-operator-crd.yaml - - https://raw.githubusercontent.com/ExcelentProject/sokar/main/open-data-hub/install/crds.yaml, - https://raw.githubusercontent.com/ExcelentProject/sokar/main/open-data-hub/client/odh-manifests-codeflare-crd.yaml, - https://raw.githubusercontent.com/ExcelentProject/sokar/main/open-data-hub/client/odh-manifests-dashboard-crd.yaml, - - https://raw.githubusercontent.com/ExcelentProject/sokar/main/open-data-hub/client/odh-manifests-kserve-crd.yaml, - https://raw.githubusercontent.com/ExcelentProject/sokar/main/open-data-hub/client/odh-manifests-model-mesh-crd.yaml, - https://raw.githubusercontent.com/ExcelentProject/sokar/main/open-data-hub/client/odh-manifests-model-mesh-overlays-odh-crd.yaml, - https://raw.githubusercontent.com/ExcelentProject/sokar/main/open-data-hub/client/odh-manifests-odh-model-controller-crd.yaml, - https://raw.githubusercontent.com/ExcelentProject/sokar/main/open-data-hub/client/odh-manifests-odh-notebook-controller-kf-notebook-controller-crd.yaml, - https://raw.githubusercontent.com/ExcelentProject/sokar/main/open-data-hub/client/odh-manifests-ray-crd.yaml, - https://raw.githubusercontent.com/ExcelentProject/sokar/main/open-data-hub/client/odh-manifests-trustyai-service-operator-crd.yaml - - true - true + 0 + + + **/IT*.java + **/*IT.java + **/ST*.java + **/*ST.java + + ${it.skip} + ${it.skip} diff --git a/src/main/java/io/odh/test/TestConstants.java b/src/main/java/io/odh/test/TestConstants.java new file mode 100644 index 00000000..324c7c4a --- /dev/null +++ b/src/main/java/io/odh/test/TestConstants.java @@ -0,0 +1,5 @@ +package io.odh.test; + +public class TestConstants { + public static final String test = "test"; +} diff --git a/src/main/java/io/opendatahub/Main.java b/src/main/java/io/opendatahub/Main.java deleted file mode 100644 index 28d36631..00000000 --- a/src/main/java/io/opendatahub/Main.java +++ /dev/null @@ -1,7 +0,0 @@ -package io.opendatahub; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/src/test/java/io/odh/test/e2e/TestBase.java b/src/test/java/io/odh/test/e2e/TestBase.java new file mode 100644 index 00000000..c748285f --- /dev/null +++ b/src/test/java/io/odh/test/e2e/TestBase.java @@ -0,0 +1,4 @@ +package io.odh.test.e2e; + +public class TestBase { +} diff --git a/src/test/java/io/odh/test/unit/UnitTests.java b/src/test/java/io/odh/test/unit/UnitTests.java new file mode 100644 index 00000000..35c4b255 --- /dev/null +++ b/src/test/java/io/odh/test/unit/UnitTests.java @@ -0,0 +1,23 @@ +package io.odh.test.unit; + +import io.fabric8.kubernetes.api.model.PodBuilder; +import io.fabric8.kubernetes.client.KubernetesClient; +import io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient; +import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer; +import org.junit.jupiter.api.Test; + +import java.util.Collections; +import java.util.Map; + +@EnableKubernetesMockClient(crud = true) +public class UnitTests { + private KubernetesClient kubernetesClient; + private KubernetesMockServer server; + + @Test + void test() { + Map matchLabel = Collections.singletonMap("foo", "bar"); + kubernetesClient.pods().resource(new PodBuilder().withNewMetadata().withName("test").withNamespace("test").endMetadata().build()).create(); + + } +}