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

[OPENJDK-2428] Test coverage for user-provided run-env.sh and Update test URI to refer new application source repo #420

Merged
merged 3 commits into from
Nov 27, 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
2 changes: 1 addition & 1 deletion tests/features/java.security.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
@ubi8/openjdk-21
Feature: Openshift S2I tests
Scenario: Check networkaddress.cache.negative.ttl has been set correctly
Given s2i build https://github.com/jboss-openshift/openshift-examples/ from binary-cli-security-property
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from binary-cli-security-property
Then s2i build log should contain networkaddress.cache.negative.ttl=0
65 changes: 36 additions & 29 deletions tests/features/java/java_s2i.feature

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/features/java/java_s2i_inc.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Feature: Openshift OpenJDK S2I tests

# test incremental builds
Scenario: Check incremental builds cache .m2
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
| variable | value |
| JAVA_ARGS | Hello from CTF test |
Then container log should contain /deployments/undertow-servlet.jar Hello from CTF test
And s2i build log should contain Downloading from central:
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet with env and incremental
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet with env and incremental
| variable | value |
| JAVA_ARGS | Hello from CTF test |
Then container log should contain /deployments/undertow-servlet.jar Hello from CTF test
Expand Down
2 changes: 1 addition & 1 deletion tests/features/java/memory.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ Feature: OPENJDK-559 JVM Memory tests
@ubi8/openjdk-17
@ubi8/openjdk-21
Scenario: Ensure Maven doesn't use MaxRAMPercentage=80
Given s2i build https://github.com/jboss-openshift/openshift-examples from spring-boot-sample-simple
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from spring-boot-sample-simple
Then s2i build log should match regex INFO Using MAVEN_OPTS.*-XX:MaxRAMPercentage=25.0$
8 changes: 4 additions & 4 deletions tests/features/java/openjdk_s2i.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ Feature: Openshift OpenJDK-only S2I tests

@ubi8/openjdk-8
Scenario: Check java perf dir owned by jboss (CLOUD-2070)
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
Then run jstat -gc 1 1000 1 in container and check its output for S0C
And run stat --printf="%U %G" /tmp/hsperfdata_jboss/ in container and check its output for jboss root

Scenario: Ensure Quarkus CDS doesn't fail due to timestamp mismatch (OPENDJK-1673)
Given s2i build https://github.com/jerboaa/quarkus-quickstarts from getting-started using quickstart-2.16-s2i-cds
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from getting-started
Then container log should not contain A jar file is not the one used while building the shared archive file

Scenario: quarkus fast-jar layout works out-of-the-box (OPENJDK-1957)
Given s2i build https://github.com/jmtd/openshift-quickstarts from quarkus-quickstarts/getting-started-3.0.1.Final-nos2i using OPENJDK-631-quarkus-fast-jar
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from quarkus-quickstarts/getting-started-3.0.1.Final-nos2i
Then container log should contain INFO quarkus fast-jar package type detected
And container log should contain -jar /deployments/quarkus-app/quarkus-run.jar
And container log should contain (main) getting-started 1.0.0-SNAPSHOT on JVM (powered by Quarkus
Expand All @@ -24,7 +24,7 @@ Feature: Openshift OpenJDK-only S2I tests
And container log should not contain no main manifest attribute

Scenario: quarkus uber-jar layout works out-of-the-box (OPENJDK-1957)
Given s2i build https://github.com/jmtd/openshift-quickstarts from quarkus-quickstarts/getting-started-3.0.1.Final-nos2i with env using OPENJDK-631-quarkus-fast-jar
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from quarkus-quickstarts/getting-started-3.0.1.Final-nos2i with env
| variable | value |
| QUARKUS_PACKAGE_TYPE | uber-jar |
Then container log should not contain INFO quarkus fast-jar package type detected
Expand Down
3 changes: 1 addition & 2 deletions tests/features/java/ports.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
@ubi8/openjdk-17
@ubi8/openjdk-21
Feature: Openshift OpenJDK port tests

Scenario: Check ports are available
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
Then check that port 8080 is open
Then check that port 8443 is open
Then inspect container
Expand Down
7 changes: 3 additions & 4 deletions tests/features/java/runtime.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
@ubi8/openjdk-17
@ubi8/openjdk-21
Feature: Openshift OpenJDK Runtime tests

Scenario: Ensure JVM_ARGS is no longer present in the run script
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
Then file /usr/local/s2i/run should not contain JVM_ARGS

Scenario: Ensure JAVA_ARGS are passed through to the running java application
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
| variable | value |
| JAVA_ARGS | Hello from CTF test |
Then container log should contain /deployments/undertow-servlet.jar Hello from CTF test

Scenario: Ensure diagnostic options work correctly
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
| variable | value |
| JAVA_ARGS | Hello from CTF test |
| JAVA_DIAGNOSTICS | true |
Expand Down
6 changes: 3 additions & 3 deletions tests/features/jolokia.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
Feature: Openshift OpenJDK Jolokia tests

Scenario: Check Environment variable is correct
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
Then run sh -c 'unzip -q -p /usr/share/java/jolokia-jvm-agent/jolokia-jvm.jar META-INF/maven/org.jolokia/jolokia-jvm/pom.properties | grep -F ${JOLOKIA_VERSION}' in container and check its output for version=

@ubi8/openjdk-8
@ubi8/openjdk-11
Scenario: Check jolokia port is available
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
Then check that port 8778 is open
And inspect container
| path | value |
Expand All @@ -17,7 +17,7 @@ Feature: Openshift OpenJDK Jolokia tests
@ubi8/openjdk-8
@ubi8/openjdk-11
Scenario: Ensure Jolokia diagnostic options work correctly
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from undertow-servlet
| variable | value |
| JAVA_ARGS | Hello from CTF test |
| JAVA_DIAGNOSTICS | true |
Expand Down
2 changes: 1 addition & 1 deletion tests/features/s2i-core.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
Feature: Openshift S2I tests
# OPENJDK-84 - /tmp/src should not be present after build
Scenario: run an s2i build and check that /tmp/src has been removed afterwards
Given s2i build https://github.com/jboss-openshift/openshift-examples from spring-boot-sample-simple
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from spring-boot-sample-simple
Then run stat /tmp/src in container and immediately check its output does not contain File:
Loading