-
Notifications
You must be signed in to change notification settings - Fork 431
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
System-Rules based tests migration #1932
Labels
theme: build
An issue or change related to the build system
Milestone
Comments
remkop
added a commit
that referenced
this issue
Feb 4, 2023
remkop
added a commit
that referenced
this issue
Feb 5, 2023
remkop
added a commit
that referenced
this issue
Feb 5, 2023
* System.exit tests * Environment variable tests
remkop
added a commit
that referenced
this issue
Feb 5, 2023
prevent UnsupportedOperationException in SystemLambda.withSecurityManager
remkop
added a commit
that referenced
this issue
Feb 5, 2023
remkop
added a commit
that referenced
this issue
Feb 6, 2023
remkop
added a commit
that referenced
this issue
Feb 6, 2023
remkop
added a commit
that referenced
this issue
Feb 6, 2023
remkop
added a commit
that referenced
this issue
Feb 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to #1930:
Problem
DefaultProviderTest
andHelpAnsiTest
tests using JUnit 4 and Stephan Birkner’s System-Rules are broken on Java 18-ea (UnsupportedOperationException
forsetSecurityManager
).I also saw some
InaccessibleObjectException
errors in the CI/CD build logs on Java 16+:Analysis
The
UnsupportedOperationException
in Java 18-ea is due to theEnvironmentVariables
rule reflection no longer working due to removal of theSystem::setSecurityManager
API in Java 18-ea. However, it looks like this API was not actually removed in Java 18's GA release.It is not clear what caused the
InaccessibleObjectException
.All tests seem to pass on Zulu Java 18 (with a warning):
At this moment we are unable to test with Java 19 because Gradle 7.4 does not support it.
This problem will resurface when the
System::setSecurityManager
API is actually removed.Solution
The solution is to move all tests that use the System-Rules
EnvironmentVariables
rule to thepicocli-legacy-tests
module.Also, add a module
picocli-tests-junit5
that uses JUnit 5 and System Lambda instead. Migrate Environment and System exit tests to this module.This module can also host other tests that require Java 8 that are currently in the
picocli-annotation-processing-tests
module:(Maybe rename
picocli-annotation-processing-tests
topicocli-tests-annotation-processing
to align the name of all test modules? Also renamepicocli-legacy-tests
topicocli-tests-legacy
.)The text was updated successfully, but these errors were encountered: