maven - Is isolation of failsafe and surefire runs from each other using a skip approach possible? -
the value of property skipits when overridden on command line appears ignored maven if used in conjunction -dit.test=full.classname. specified failsafe test not run (case one).
as opposed specifiing skipits without it.test switch leads running of existing failsafe tests (case two).
background: trying isolate surefire tests failsafe tests runs namely either running both types of them or 1 of each only. maven calls are:
mvn -pintegration -dskiptests=true -dskipits=false -dit.test=full.classname verify in first case and:
mvn -pintegration -dskiptests=true -dskipits=false verify in second.
the relevant configuration (pom.xml, snippets only) being:
<properties> <skiptests>false</skiptests> <skipits>false</skipits> </properties> (those defaults) and
<profiles> <profile> <id>integration</id> <build> <plugins> <plugin> <artifactid>maven-failsafe-plugin</artifactid> <executions> <execution> <id>custom<id> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> <configuration> <skiptests>${skipits}</skiptests> <skip>${skipits}</skip> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> did observe or have found better working approach?
by default, surefire plugins runs during test phase , configure failsafe plugin run during integration-test , verify phase this:
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-failsafe-plugin</artifactid> <version>2.18.1</version> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> </plugin> to run surefire tests only, use
mvn clean test to run both surefire , failsafe tests, use
mvn clean verify you can skip plugin using <skip> configuration option. if configure surefire plugin this:
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.18.1</version> <configuration> <skip>${skip.surefire}</skip> </configuration> </plugin> you can run failsafe tests calling
mvn clean verify -dskip.surefire=true
Comments
Post a Comment