测试结果在 Jenkins 中显示失败的重复条目

Cha*_*how 5 continuous-integration pom.xml jenkins maven-surefire-plugin

在此输入图像描述

我正在使用 Surefire 报告插件在 Jenkins 中记录 SoapUI 测试结果。

<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>
Run Code Online (Sandbox Code Playgroud)

在 Jenkins 上运行作业后,我在报告中看到每个故障的两个条目。我有发布 JUnit 报告的构建后操作。

Cha*_*how 4

真正的问题在于詹金斯。Jenkins 构建后操作有一个“发布 JUnit 测试结果报告”操作。这需要目标报告路径的输入。如果你使用

target/surefire-reports/*-xml
Run Code Online (Sandbox Code Playgroud)

结果将报告两次。您只需通过/TEST*-xml一次即可获得结果报告。