It says in the documentation that the verify phase in the build lifecycle
run any checks on results of integration tests to ensure quality criteria are met
What does this exactly mean?
Based on official documentation: TEST - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed. VERIFY - run any checks on results of integration tests to ensure quality criteria are met.
Verify is just another build lifecycle in maven so you can run it in command line from within the directory of your pom. xml file like any other maven command . If you want to run it from eclipse navigate to Run >> Run Configuration menu, select Maven build from left sidebar and make your own maven build.
To run all the unit tests with Maven run command $ mvn test or $ mvn clean test . If you use clean , all the resources and compiled java code generated by maven in target directory will be cleaned and run tests freshly.
The verify
phase will indeed verify the integration tests results, if one or more results have failed or not.
Usually the maven-failsafe-plugin is used to orchestrate the lifecycle of the integration tests, it has two goals:
In the case of the verify goal, as per documentation:
Binds by default to the lifecycle phase: verify.
In the usage section of the documentation you can check some more discussion around the verify for each testing provider it is available
For this particular piece of configuration, the verify will check if some of summary files have any failures:
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
<configuration>
<summaryFiles>
<summaryFile>target/failsafe-reports/failsafe-summary-red-bevels.xml</summaryFile>
<summaryFile>target/failsafe-reports/failsafe-summary-no-bevels.xml</summaryFile>
</summaryFiles>
</configuration>
</execution>
Edit 1
Some interesting article can be found in here around the maven configuration for this.
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