-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8366678: Use JUnit in test/langtools/tools/javac #27046
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
8366678: Use JUnit in test/langtools/tools/javac #27046
Conversation
👋 Welcome back cstein! A progress list of the required criteria for merging this PR into |
@sormuras This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
@sormuras this pull request can not be integrated into git checkout JDK-8366678-use-junit-in-javac-tests
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
5bb112e
to
0b0cac1
Compare
- Make argument source factory method `static` Solves: ``` Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' must be static: local factory methods must be static unless the PER_CLASS @testinstance lifecycle mode is used; external factory methods must always be static. ``` - Make `@AfterAll`-annotated method `static` Solves: ``` [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' must be static unless the test class is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. ``` - Rename test property to `JUnit.dirs` Solves: ``` package org.junit.jupiter.api does not exist ``` - Add custom test instance factory Solves: ``` Class [FDTests] must declare a single constructor Class [MethodReferenceTestKinds] must declare a single constructor ```
This configuration error should have been detected by JUnit Jupiter and reported via the Discovery Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues
Webrevs
|
Please run |
test/langtools/tools/javac/file/MultiReleaseJar/MultiReleaseJarTest.java
Show resolved
Hide resolved
test/langtools/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestKinds.java
Outdated
Show resolved
Hide resolved
test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/javac/FDTest.java
Outdated
Show resolved
Hide resolved
test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/vm/FDSeparateCompilationTest.java
Show resolved
Hide resolved
That way, Jupiter doesn't need the help of a custom test instance factory
test/langtools/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestInnerDefault.java
Show resolved
Hide resolved
test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/vm/FDSeparateCompilationTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual changes look good - unfortunately github does not show the correct ... diff.
The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork: git checkout JDK-8366678-use-junit-in-javac-tests
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push |
…nit-in-javac-tests # Conflicts: # test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge looks trivial
/integrate |
Going to push as commit 682fd78.
Your commit was automatically rebased without conflicts. |
Please review this change to use JUnit in tests of
test/langtools/tools/javac
.Assess Status Quo
A local
make test TEST=test/langtools/tools/javac
run before the conversion yields:Perform Automatic Conversion
Perform Manual Adjustments
Some of the following adjustments will be integrated into the
junit-convert
tool.Make argument source factory method
static
Make
@AfterAll
-annotated methodstatic
Remove
static
modifier from@Test
-annotated methodsThis configuration error should have been detected by JUnit Jupiter and reported via the Discovery
Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues
Rename test property to
JUnit.dirs
Prune extra contructors
Initially by adding custom test instance factory to help JUnit select the correct constructor.
Now by deleting all-but-one constructor to used by file-local code and JUnit alike.
Results
Re-run tests via
make test TEST=test/langtools/tools/javac
after the conversion; yielding:Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27046/head:pull/27046
$ git checkout pull/27046
Update a local copy of the PR:
$ git checkout pull/27046
$ git pull https://git.openjdk.org/jdk.git pull/27046/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27046
View PR using the GUI difftool:
$ git pr show -t 27046
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27046.diff
Using Webrev
Link to Webrev Comment