-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Workflow tests - junit reports (#5881)
* status page examples, curl workflows updated * cypress test updated - junit * playwright and postman - junit examples * workflow tests - pytest project * workflow tests - pytest project - test files renamed * workflow tests - pytest - pytest.ini * workflow tests - pytest - pytest.ini updated * workflow tests - junit5 * workflow tests - junit5 tests - pom updated * workflow tests - junit5 tests - filenames updated * workflow tests - junit5 * workflow tests - junit5 tests added * workflow tests - junit5 pom updated * workflow tests - junit5 pom updated * workflow tests - junit5 pom updated * workflow tests - junit5 pom updated * workflow tests - junit5 * workflow tests - junit5 * workflow tests - junit5 * workflow tests - junit5 * workflow tests - junit5 * workflow tests - junit5 * junit 5 project - pom fixed * junit 5 - pom updated (junit report) * junit 5 - pom updated (junit report) * junit 5 - tests updated * junit 5 - tests extended * workflow tests - suites updated * workflow tests - pytest * workflow tests - suites extended, run scirpt * junit target removed
- Loading branch information
1 parent
542c5e1
commit 65f6c2a
Showing
26 changed files
with
663 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
apiVersion: testworkflows.testkube.io/v1 | ||
kind: TestWorkflow | ||
metadata: | ||
name: tw-testkube-website-5m | ||
spec: | ||
events: | ||
- cronjob: | ||
cron: '*/5 * * * *' | ||
container: | ||
image: curlimages/curl:8.7.1 | ||
resources: | ||
requests: | ||
cpu: 32m | ||
memory: 32Mi | ||
steps: | ||
- name: Run tests | ||
shell: curl -f -LI https://testkube.io | ||
--- | ||
apiVersion: testworkflows.testkube.io/v1 | ||
kind: TestWorkflow | ||
metadata: | ||
name: tw-testkube-docs-5m | ||
spec: | ||
events: | ||
- cronjob: | ||
cron: '*/5 * * * *' | ||
container: | ||
image: curlimages/curl:8.7.1 | ||
resources: | ||
requests: | ||
cpu: 32m | ||
memory: 32Mi | ||
steps: | ||
- name: Run tests | ||
shell: curl -f -LI https://docs.testkube.io | ||
--- | ||
apiVersion: testworkflows.testkube.io/v1 | ||
kind: TestWorkflow | ||
metadata: | ||
name: tw-testkube-blog-5m | ||
spec: | ||
events: | ||
- cronjob: | ||
cron: '*/5 * * * *' | ||
container: | ||
image: curlimages/curl:8.7.1 | ||
resources: | ||
requests: | ||
cpu: 32m | ||
memory: 32Mi | ||
steps: | ||
- name: Run tests | ||
shell: curl -f -LI https://testkube.io/blog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
apiVersion: testworkflows.testkube.io/v1 | ||
kind: TestWorkflow | ||
metadata: | ||
name: junit5-workflow-smoke | ||
labels: | ||
core-tests: workflows | ||
spec: | ||
content: | ||
git: | ||
uri: https://github.com/kubeshop/testkube | ||
revision: workflow-tests-junit # TODO: update | ||
paths: | ||
- test/junit/junit5-project | ||
container: | ||
image: maven:3.9.9-eclipse-temurin-11-alpine | ||
resources: | ||
requests: | ||
cpu: 256m | ||
memory: 256Mi | ||
workingDir: /data/repo/test/junit/junit5-project | ||
steps: | ||
- name: Run tests | ||
shell: mvn test -Dtest=TestSmoke1,TestSmoke2 | ||
artifacts: | ||
paths: | ||
- 'target/surefire-reports/**/*' | ||
--- | ||
apiVersion: testworkflows.testkube.io/v1 | ||
kind: TestWorkflow | ||
metadata: | ||
name: junit5-workflow-smoke-expected-fail | ||
labels: | ||
core-tests: expected-fail | ||
spec: | ||
content: | ||
git: | ||
uri: https://github.com/kubeshop/testkube | ||
revision: workflow-tests-junit # TODO: update | ||
paths: | ||
- test/junit/junit5-project | ||
container: | ||
image: maven:3.9.9-eclipse-temurin-11-alpine | ||
resources: | ||
requests: | ||
cpu: 256m | ||
memory: 256Mi | ||
workingDir: /data/repo/test/junit/junit5-project | ||
steps: | ||
- name: Run tests | ||
shell: mvn test -Dtest=TestSmokeFail | ||
artifacts: | ||
paths: | ||
- 'target/surefire-reports/**/*' | ||
--- | ||
apiVersion: testworkflows.testkube.io/v1 | ||
kind: TestWorkflow | ||
metadata: | ||
name: junit5-workflow-smoke-mixed-results | ||
labels: | ||
core-tests: expected-fail | ||
spec: | ||
content: | ||
git: | ||
uri: https://github.com/kubeshop/testkube | ||
revision: workflow-tests-junit # TODO: update | ||
paths: | ||
- test/junit/junit5-project | ||
container: | ||
image: maven:3.9.9-eclipse-temurin-11-alpine | ||
resources: | ||
requests: | ||
cpu: 256m | ||
memory: 256Mi | ||
workingDir: /data/repo/test/junit/junit5-project | ||
steps: | ||
- name: Run tests | ||
shell: mvn test | ||
artifacts: | ||
paths: | ||
- 'target/surefire-reports/**/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?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>example.testsuite</groupId> | ||
<artifactId>example-testsuite</artifactId> | ||
<version>1.0</version> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<version>5.11.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>3.5.0</version> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.13.0</version> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import java.util.concurrent.TimeUnit; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
public class TestSmoke1 { | ||
@BeforeEach | ||
public void beforeEach() { | ||
try { | ||
TimeUnit.SECONDS.sleep(1); | ||
} | ||
catch(Exception e) { | ||
System.out.println(e); | ||
} | ||
} | ||
|
||
@Test | ||
public void test1() { | ||
assertEquals(1, 1); | ||
} | ||
|
||
@Test | ||
public void test2() { | ||
assertEquals(1, 1); | ||
} | ||
|
||
@Test | ||
public void test3() { | ||
assertEquals(1, 1); | ||
} | ||
|
||
@Test | ||
public void test4() { | ||
try { | ||
TimeUnit.SECONDS.sleep(3); | ||
} | ||
catch(Exception e) { | ||
System.out.println(e); | ||
} | ||
|
||
assertEquals(1, 1); | ||
} | ||
|
||
@Test | ||
public void test5() { | ||
assertEquals(1, 1); | ||
} | ||
|
||
@Test | ||
public void test6() { | ||
try { | ||
TimeUnit.SECONDS.sleep(6); | ||
} | ||
catch(Exception e) { | ||
System.out.println(e); | ||
} | ||
|
||
assertEquals(1, 1); | ||
} | ||
} |
Oops, something went wrong.