From 1d5f23bdcd14ba17c9214ec4bdc96abc1429f1d8 Mon Sep 17 00:00:00 2001 From: Tomasz Konieczny Date: Mon, 23 Oct 2023 15:50:22 +0200 Subject: [PATCH 1/2] Maven example for jdk8 --- .../maven/examples/hello-maven-jdk8/pom.xml | 53 +++++++++++++++++++ .../test/java/hello/maven/LibraryTest.java | 11 ++++ test/maven/executor-smoke/crd/crd.yaml | 14 ++--- 3 files changed, 71 insertions(+), 7 deletions(-) create mode 100644 contrib/executor/maven/examples/hello-maven-jdk8/pom.xml create mode 100644 contrib/executor/maven/examples/hello-maven-jdk8/src/test/java/hello/maven/LibraryTest.java diff --git a/contrib/executor/maven/examples/hello-maven-jdk8/pom.xml b/contrib/executor/maven/examples/hello-maven-jdk8/pom.xml new file mode 100644 index 00000000000..fb0dd4677b5 --- /dev/null +++ b/contrib/executor/maven/examples/hello-maven-jdk8/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + hello.maven + hello-maven + 1.0 + + + 11 + 5.7.2 + UTF-8 + + + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-jupiter.version} + test + + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M5 + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + 11 + + + + + + + \ No newline at end of file diff --git a/contrib/executor/maven/examples/hello-maven-jdk8/src/test/java/hello/maven/LibraryTest.java b/contrib/executor/maven/examples/hello-maven-jdk8/src/test/java/hello/maven/LibraryTest.java new file mode 100644 index 00000000000..09253694070 --- /dev/null +++ b/contrib/executor/maven/examples/hello-maven-jdk8/src/test/java/hello/maven/LibraryTest.java @@ -0,0 +1,11 @@ +package hello.maven; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +class LibraryTest { + @Test void runMavenTests() { + String env = System.getenv("TESTKUBE_MAVEN"); + assertTrue(Boolean.parseBoolean(env), "TESTKUBE_MAVEN env should be true"); + } +} diff --git a/test/maven/executor-smoke/crd/crd.yaml b/test/maven/executor-smoke/crd/crd.yaml index 0d8c4a2f65f..3654d0ae677 100644 --- a/test/maven/executor-smoke/crd/crd.yaml +++ b/test/maven/executor-smoke/crd/crd.yaml @@ -12,9 +12,9 @@ spec: type: git repository: type: git - uri: https://github.com/kubeshop/testkube-executor-maven.git + uri: https://github.com/kubeshop/testkube.git branch: main - path: examples/hello-maven-jdk18 + path: contrib/executor/maven/examples/hello-maven-jdk18 executionRequest: variables: TESTKUBE_MAVEN: @@ -36,9 +36,9 @@ spec: type: git repository: type: git - uri: https://github.com/kubeshop/testkube-executor-maven.git + uri: https://github.com/kubeshop/testkube.git branch: main - path: examples/hello-maven + path: contrib/executor/maven/examples/hello-maven executionRequest: variables: TESTKUBE_MAVEN: @@ -60,10 +60,10 @@ spec: type: git repository: type: git - uri: https://github.com/kubeshop/testkube-executor-maven.git + uri: https://github.com/kubeshop/testkube.git branch: main - path: examples/hello-maven-jdk18 + path: contrib/executor/maven/examples/hello-maven-jdk18 executionRequest: negativeTest: true jobTemplate: "apiVersion: batch/v1\nkind: Job\nspec:\n template:\n spec:\n containers:\n - name: \"{{ .Name }}\"\n image: {{ .Image }}\n resources:\n requests:\n memory: 256Mi\n cpu: 256m\n" - activeDeadlineSeconds: 180 \ No newline at end of file + activeDeadlineSeconds: 180 From 732e4ea979d57ea4b9191f86a9248796d78e7746 Mon Sep 17 00:00:00 2001 From: Tomasz Konieczny Date: Mon, 23 Oct 2023 15:56:59 +0200 Subject: [PATCH 2/2] Maven example for jdk8, tests --- .../maven/examples/hello-maven-jdk8/pom.xml | 4 ++-- test/maven/executor-smoke/crd/crd.yaml | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/contrib/executor/maven/examples/hello-maven-jdk8/pom.xml b/contrib/executor/maven/examples/hello-maven-jdk8/pom.xml index fb0dd4677b5..452552d6007 100644 --- a/contrib/executor/maven/examples/hello-maven-jdk8/pom.xml +++ b/contrib/executor/maven/examples/hello-maven-jdk8/pom.xml @@ -42,8 +42,8 @@ maven-compiler-plugin 3.8.1 - 11 - 11 + 8 + 8 diff --git a/test/maven/executor-smoke/crd/crd.yaml b/test/maven/executor-smoke/crd/crd.yaml index 3654d0ae677..947df4f1715 100644 --- a/test/maven/executor-smoke/crd/crd.yaml +++ b/test/maven/executor-smoke/crd/crd.yaml @@ -50,6 +50,30 @@ spec: --- apiVersion: tests.testkube.io/v3 kind: Test +metadata: + name: maven-executor-smoke-jdk8 + labels: + core-tests: executors +spec: + type: maven:jdk8/test + content: + type: git + repository: + type: git + uri: https://github.com/kubeshop/testkube.git + branch: maven-8-test-restored + path: contrib/executor/maven/examples/hello-maven-jdk8 + executionRequest: + variables: + TESTKUBE_MAVEN: + name: TESTKUBE_MAVEN + value: "true" + type: basic + jobTemplate: "apiVersion: batch/v1\nkind: Job\nspec:\n template:\n spec:\n containers:\n - name: \"{{ .Name }}\"\n image: {{ .Image }}\n resources:\n requests:\n memory: 256Mi\n cpu: 256m\n" + activeDeadlineSeconds: 180 +--- +apiVersion: tests.testkube.io/v3 +kind: Test metadata: name: maven-executor-smoke-jdk18-negative # expected failure - ENVs not set labels: