To build continuous integration, we use JcCoCo to minimize the number of tests that need to be run. However, according to some signs, he determines that there are no tests at all. For example, if only the image was changed.
Here is a snippet from build.xml :
<fileset id="int.tests" dir="${build.inttest.source}/java"> <include name="**/*Test.java"/> </fileset> <taskdef name="testng" classname="org.testng.TestNGAntTask" classpath="${build.jars.test}/testng.jar"/> <jacoco:coverage destfile="./inttest-jacoco.exec"> <testng outputDir="./reports/intTest" failureproperty="testNGFailed" haltonfailure="false" verbose="2" workingDir="${build.dir}" classfilesetref="int.tests"> <classpath> <path refid="build.inttest.classpath"/> </classpath> </testng> </jacoco:coverage>
When tests fail, the testNGFailed property testNGFailed set to true, and the assembly is not subsequently executed.
The entry in this scenario is as follows:
13:16:49,116 INFO - [testng]
How can I complete the assembly of the assembly when there is no test to be launched, but failure if testing fails?
Can I get Jacoco to always run at least one test?
Can I make TestNG set to failproperty only when testing fails?
testng ant jacoco
WW.
source share