【问题标题】:SoapUI, Maven, Surefire and Jenkins IntegrationSoapUI、Maven、Surefire 和 Jenkins 集成
【发布时间】:2017-05-07 05:42:09
【问题描述】:

我正在尝试使用 maven、surefire 和 jenkins 运行 SoapUI xml 项目文件。 对于 maven 和 jenkins 来说一切都很好,构建完成后,Junit 报告会显示在 jenkins 中(带有非常基本的信息 - 测试用例名称和状态)

我想使用 surefire 来显示报告和日志(我可以在 target/surfire-report/ 中看到日志文件的所有 *.xml 和 *.txt)。 如何配置jenkins显示surefire报告和日志文件?

这是我的 pom.xml 文件

    <pluginRepositories>
    <pluginRepository>
        <id>smartbear-sweden-plugin-repository</id>
        <url>http://www.soapui.org/repository/maven2/</url>
    </pluginRepository>
</pluginRepositories>
<build>
    <plugins>
        <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-maven-plugin</artifactId>
            <version>5.3.0</version>
            <configuration>
                <projectFile>${basedir}/src/test/java/Test-API-soapui-project.xml</projectFile>
                <outputFolder>${basedir}/target/surefire-reports/</outputFolder>
                <junitReport>true</junitReport>
                <exportwAll>true</exportwAll>
                <printReport>true</printReport>
            </configuration>
            <executions>
                <execution>
                    <id>soapUI</id>
                    <phase>integration-test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>com.smartbear.soapui</groupId>
                    <artifactId>soapui</artifactId>
                    <version>5.3.0</version>
                    <exclusions>
                        <exclusion>
                            <groupId>javafx</groupId>
                            <artifactId>jfxrt</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.20</version>
        </plugin>
    </plugins>
</build>

【问题讨论】:

    标签: java maven jenkins maven-surefire-plugin


    【解决方案1】:

    不确定你是否解决了这个问题,但我就是这样做的。

    在 Jenkins 中为您的项目构建添加构建后操作 发布 junit 测试报告结果。 将 Test report XMLs 设置为指向您的 target/surefire-reports 目录,您可以在其中看到正在编写的报告。 在下面的示例中,我在 config 目录中的子模块“dev”中运行测试。 你会知道它什么时候是正确的,因为如果 Jenkins 找不到报告 xml,它会显示一条红色的错误消息,当它找到你告诉他们的报告 xml 时什么也没有。

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-02
      • 1970-01-01
      • 2017-11-04
      • 1970-01-01
      • 2012-04-05
      相关资源
      最近更新 更多