首页 > 解决方案 > 标记詹金斯构建不稳定

问题描述

即使只有一个测试用例失败,我的构建也会被标记为失败。在那种情况下,我想让它不稳定。正如我所读到的,它取决于用于执行构建的插件。在 Jenkins wiki 我也发现了类似的东西:

如果构建成功并且一个或多个发布者报告它不稳定,则构建是不稳定的。例如,如果配置了 JUnit 发布者并且测试失败,则构建将被标记为不稳定。

我使用了带有 HTMLReporter 的 maven surefire 插件作为发布者:

            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
                <testFailureIgnore>false</testFailureIgnore>
                <suiteXmlFiles>
                    <suiteXmlFile>src\test\java\testCases\scenarios\${tests}</suiteXmlFile>
                </suiteXmlFiles>
                <properties>
                    <property>
                        <name>usedefaultlisteners</name>
                        <value>false</value>
                    </property>
                    <property>
                        <name>listener</name>
                        <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>
                    </property>
                </properties>
            </configuration>
            <executions>
                <execution>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <skip>false</skip>
                    </configuration>
                </execution>
            </executions>
        </plugin>

标签: jenkinstestngmaven-surefire-plugin

解决方案


推荐阅读