Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Maven jdk 8 test, example (based on the one for 11) #4501

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions contrib/executor/maven/examples/hello-maven-jdk8/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>hello.maven</groupId>
<artifactId>hello-maven</artifactId>
<version>1.0</version>

<properties>
<java.version>11</java.version>
<junit-jupiter.version>5.7.2</junit-jupiter.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>

<!-- junit 5 -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>

<!-- Need at least 2.22.0 to support JUnit 5 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>

</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -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");
}
}
38 changes: 31 additions & 7 deletions test/maven/executor-smoke/crd/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -36,9 +36,33 @@ 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:
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-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:
Expand All @@ -60,10 +84,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
activeDeadlineSeconds: 180
Loading