Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven: Surefire --dry-run?

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.

like image 677
Ondra Žižka Avatar asked Nov 04 '11 16:11

Ondra Žižka


People also ask

How do I run surefire test?

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”.

How do I run a Maven clean install without a test?

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.

How do I run only failed test cases in Maven?

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.

What is surefire in Maven?

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)


2 Answers

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.

like image 141
Ondra Žižka Avatar answered Nov 15 '22 07:11

Ondra Žižka


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.

like image 44
SingleShot Avatar answered Nov 15 '22 07:11

SingleShot