New to POM and Maven.
How do I create a Maven Enforcement Rule that shows the test failure even though the build passed, in Jenkins?
Scenario :
- Selenium tests run ( via testng.xml )
- Some tests failed
- Build passes
- Cucumber Report is generated.
- Build History Icon in Jenkins is now Green.
Goal :
- How do I enforce a rule so that I can show a "RED" icon instead ( Jenkins ), to indicate that there is a test failure?
Caveat :
- The report will not be generated if the Build lifecycle fails.
Here's my POM.
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>com.trivago.rta</groupId>
<artifactId>cluecumber-report-plugin</artifactId>
<version>${cluecumber-report.version}</version>
<executions>
<execution>
<id>report</id>
<phase>post-integration-test</phase>
<goals>
<goal>reporting</goal>
</goals>
</execution>
</executions>
<configuration>
<sourceJsonReportDirectory>${project.build.directory}/cucumber-report</sourceJsonReportDirectory>
<generatedHtmlReportDirectory>test-report/generated-cluecumber-report</generatedHtmlReportDirectory>
<expandBeforeAfterHooks>true</expandBeforeAfterHooks>
</configuration>
</plugin>
</plugins>
</build>
</project>
Aucun commentaire:
Enregistrer un commentaire