Search code examples
jenkinscontinuous-integrationpom.xmlmaven-surefire-plugin

Test results are displayed with duplicate entries for failures in Jenkins


enter image description here

I am using surefire reports plugin to log the SoapUI test results in Jenkins.

<groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-pro-maven-plugin</artifactId>
            <version>5.1.2</version>
            <executions>
                <execution>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <projectFile>${basedir}/i-services-bkt.xml</projectFile>
                        <outputFolder>${basedir}/target/surefire-reports</outputFolder>
                        <junitReport>true</junitReport>
                        <junitHtmlReport>false</junitHtmlReport>
                        <exportAll>true</exportAll>
                        <printReport>true</printReport>
                        <testFailIgnore>true</testFailIgnore>
                    </configuration>
                </execution>
            </executions>

After the job is run on Jenkins, I see two entries for each failure in the report. I have post build action with publish JUnit report.


Solution

  • The real issue is with Jenkins. Jenkins post-build actions have a "Publish JUnit Test Results Report" action. This takes an input of the target reports path. If you use

    target/surefire-reports/*-xml
    

    the results will be reported twice. You need to pass /TEST*-xml to get results reported just once.