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-2722] Split the tests inside tests/features/java/runtime.feature to couple them with appropriate modules #465

Merged
merged 2 commits into from
Mar 19, 2024
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
19 changes: 19 additions & 0 deletions modules/jvm/api/tests/features/runtime.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@ubi8/openjdk-8
@ubi8/openjdk-11
@ubi8/openjdk-17
@ubi8/openjdk-21
Feature: OpenJDK Runtime tests

@ubi8
Scenario: Check JAVA_OPTS overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTS | --show-version |
Then container log should not contain -XX:MaxRAMPercentage

@ubi8
Scenario: Check empty JAVA_OPTS overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTS | |
Then container log should not contain -XX:MaxRAMPercentage
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,13 @@
@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-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-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-container-images/openjdk-test-applications from undertow-servlet
| variable | value |
| JAVA_ARGS | Hello from CTF test |
| JAVA_DIAGNOSTICS | true |
Then container log should contain /deployments/undertow-servlet.jar Hello from CTF test
And container log should contain -XX:NativeMemoryTracking=summary

@ubi8
Scenario: OPENJDK-474 to ensure JAVA_ARGS is not duplicated in the java command line
Given container is started with env
| variable | value |
| JAVA_ARGS | unique |
Then container log should not contain unique unique

@ubi8
Scenario: Check JAVA_APP_NAME can contain spaces (OPENJDK-104)
Given container is started with env
| variable | value |
| JAVA_APP_NAME | foo bar |
Then container log should not contain exec: bar': not found

@ubi8
Scenario: Check JAVA_OPTS overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTS | --show-version |
Then container log should not contain -XX:MaxRAMPercentage

@ubi8
Scenario: Check empty JAVA_OPTS overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTS | |
Then container log should not contain -XX:MaxRAMPercentage

Scenario: JAVA_OPTIONS sets JAVA_OPTS and overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTIONS | --show-version |
Then container log should not contain -XX:MaxRAMPercentage
And container log should contain --show-version

@ubi8
Scenario: Check default JAVA_APP_DIR (OPENJDK-2033)
When container is ready
Expand All @@ -81,3 +35,27 @@ Feature: Openshift OpenJDK Runtime tests
| variable | value |
| JAVA_APP_DIR | /nope |
Then available container log should contain ERROR No directory /nope found for auto detection
Scenario: Ensure JVM_ARGS is no longer present in the run script
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-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-container-images/openjdk-test-applications from undertow-servlet
| variable | value |
| JAVA_ARGS | Hello from CTF test |
| JAVA_DIAGNOSTICS | true |
Then container log should contain /deployments/undertow-servlet.jar Hello from CTF test
And container log should contain -XX:NativeMemoryTracking=summary

@ubi8
Scenario: OPENJDK-474 to ensure JAVA_ARGS is not duplicated in the java command line
Given container is started with env
| variable | value |
| JAVA_ARGS | unique |
Then container log should not contain unique unique
12 changes: 12 additions & 0 deletions modules/s2i/bash/tests/features/java.s2i.runtime.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@ubi8/openjdk-8
@ubi8/openjdk-11
@ubi8/openjdk-17
@ubi8/openjdk-21
Feature: OpenJDK JAVA s2i Runtime tests

Scenario: JAVA_OPTIONS sets JAVA_OPTS and overrides defaults (OPENJDK-2009)
Given container is started with env
| variable | value |
| JAVA_OPTIONS | --show-version |
Then container log should not contain -XX:MaxRAMPercentage
And container log should contain --show-version
Loading