-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Introduce a Unique ID tracking TestExecutionListener #2619
Comments
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
May 25, 2021
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
May 25, 2021
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
May 25, 2021
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
May 25, 2021
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
May 25, 2021
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
May 26, 2021
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
May 26, 2021
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
May 27, 2021
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
May 27, 2021
7 tasks
7 tasks
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
May 31, 2021
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
May 31, 2021
sbrannen
added a commit
that referenced
this issue
Jun 4, 2021
Reopening this issue in order to track skipped tests as well. |
Reopening to support concurrent use cases. See graalvm/native-build-tools#84 for details. |
sbrannen
added a commit
to sbrannen/junit5
that referenced
this issue
Jul 1, 2021
runningcode
pushed a commit
to runningcode/junit5
that referenced
this issue
Feb 15, 2023
This commit introduces UniqueIdTrackingListener which is a TestExecutionListener that tracks the unique IDs of all tests that were executed during the TestPlan and generates a file containing the unique IDs. The generated file can be used to rerun those tests -- for example, in order to run the same set of tests executed on the JVM subsequently within a GraalVM native image. See the Javadoc for UniqueIdTrackingListener for configuration options and details. Closes junit-team#2619
runningcode
pushed a commit
to runningcode/junit5
that referenced
this issue
Feb 15, 2023
runningcode
pushed a commit
to runningcode/junit5
that referenced
this issue
Feb 15, 2023
runningcode
pushed a commit
to runningcode/junit5
that referenced
this issue
Feb 15, 2023
Prior to this commit, the UniqueIdTrackingListener wrote to an output file with a specific name. This approach works fine when only one listener is writing the file per test suite. However, when multiple TestPlans are executed in parallel for the same test suite (for example, with parallel test execution in a Gradle build), each UniqueIdTrackingListener will attempt to recreate and write to the exact same file. The result is that the "last one wins", meaning that the output file only contains the tracked UIDs for the last UniqueIdTrackingListener, and all other tracked UIDs are lost. This commit fixes this by ensuring that each UniqueIdTrackingListener instance writes to an output file that includes a random number in the file name, thereby creating one unique output file per listener. Consequently, consumers of the output files must now read the UIDs from all such output files. In addition, the output files must be deleted prior to TestPlan execution since the UniqueIdTrackingListener no longer overwrites the previous output file. Closes junit-team#2619
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
Inspired by the simple
TestClassTrackingTestExecutionListener
that I introduced as a proof of concept in the test suite for the Spring Framework, we should introduce aUniqueIdTrackingListener
as an implementation of theTestExecutionListener
API for the JUnit Platform.UniqueIdTrackingListener
would track the unique IDs of all "tests" (not containers) that were executed during the execution of test plan. It would track all tests, regardless of the success/failure status of the test, and write the unique IDs to a text file.The text file can then be used by a build tool or plugin to execute the same set of tests again without having to query the user configuration for the test plan and without having to perform classpath scanning again to discover tests.
This can be useful for test environments such as within a native image -- for example, a GraalVM native image -- in order to rerun the exact same tests from a standard JVM test run within a native image.
Deliverables
UniqueIdTrackingListener
in thejunit-platform-launcher
module.UniqueIdTrackingListener
by default via Java'sServiceLoader
mechanism.UniqueIdTrackingListener
an opt-in feature. If a specific JVM system property has not been set totrue
, the registeredUniqueIdTrackingListener
would serve as a no-op listener and not do anything.pom.xml
or*.gradle
/*.gradle.kts
respectively.UniqueIdTrackingListener
in Javadoc.UniqueIdTrackingListener
in the User Guide.TestExecutionListener
implementations, this will be addressed in a separate issue.UniqueIdTrackingListener
in the Release Notes.The text was updated successfully, but these errors were encountered: