Something like the following.
I would like a way to skip my dao tests in surefire. Trying to avoid overhead of defining Suites.
With CI I'd like to have one nightly that runs all tests and another 5 minute poll of SCM that runs only 'fast' tests.
mvn -DskipPattern=**.dao.** test
It is possible to exclude tests using the commandline; using
!
to exclude.Note: I'm not sure but possibly needs 2.19.1 or later version of surefire to work.
Examples:
This will not run
TestHCatLoaderEncryption
Exclude a package:
This can be combined with positive filters as well. The following will run 0 tests:
See the Maven Surefire docs.
Sure, no problem:
Reference:
(The excludes can not be configured via command line, so if you want to turn this behavior on conditionally, you will have to define a profile and activate that on the command line)
Let me extend Sean's answer. This is what you set in
pom.xml
:Then in CI you start them like this:
That's it.