Is there some way to dry-run surefire? Something which would list which tests would run, without running them.
The goal is, to know which tests (would) run in JBoss AS7 testsuite under certain config.
Execute a Single Test Class The Maven surefire plugin provides a test parameter that we can use to specify test classes or methods we want to execute. If we want to execute a single test class, we can execute the command mvn test -Dtest=”TestClassName”.
To skip running the tests for a particular project, set the skipTests property to true. You can also skip the tests via the command line by executing the following command: mvn install -DskipTests.
During development, you may re-run failing tests because they are flaky. To use this feature through Maven surefire, set the rerunFailingTestsCount property to be a value larger than 0. Tests will be run until they pass or the number of reruns has been exhausted.
The Surefire Plugin is used during the test phase of the build lifecycle to execute the unit tests of an application. It generates reports in two different file formats: Plain text files (*. txt)
There's a change by Janinko at https://github.com/janinko/maven-surefire/tree/feature/dryrun Which adds this option:
-Dtest.dryrun=true
Hopefully it will get to upstream.
UPDATE 2021: Note that this fork of maven-surefire
has not been updated for 9 years.
No. If you want to verify you are running a subset of your tests under a particular configuration, you will have to do it after the fact via a surefire report or similar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With