当我尝试通过Maven(surefire)一起使用Cucumber和Junit时,那么报告错误的测试数量。我只有250次测试,但詹金斯显示我有1200次测试。所以,当我调查它时,我只能找到一个参考,那就是surefire插件的问题。黄瓜和junit在jenkins中有错误的测试数量(surefire)
https://github.com/cucumber/cucumber-jvm/issues/322
如何纠正它吗?
当我尝试通过Maven(surefire)一起使用Cucumber和Junit时,那么报告错误的测试数量。我只有250次测试,但詹金斯显示我有1200次测试。所以,当我调查它时,我只能找到一个参考,那就是surefire插件的问题。黄瓜和junit在jenkins中有错误的测试数量(surefire)
https://github.com/cucumber/cucumber-jvm/issues/322
如何纠正它吗?
我只能用surefire创建hack。如果你喜欢,你可以使用:
示例的变化:
<plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>change-bad-cucumber-test-file</id>
<!-- here the phase you need -->
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/surefire-reports-fixed</outputDirectory>
<resources>
<resource>
<directory>${basedir}/target/cucumber</directory>
</resource>
<resource>
<directory>${basedir}/target/surefire-reports</directory>
<excludes>
<exclude>**/*CucumberTest.*</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
变化CucumberTest.java:
@RunWith(Cucumber.class)
@Cucumber.Options(format = { "pretty", "junit:target/cucumber/TEST-packageHereToClass.CucumberTest.xml", "json:target/cucumber.json" })
public class CucumberTest {
...
}
在詹金斯
设置万无一失文件夹测试(2)“万无一失的报告网络连接xed'
以下链接似乎是相关的。
讨论的步骤定义计算作为测试的核心问题:
https://github.com/cucumber/cucumber-jvm/issues/577
独立的问题,它在评论,论述了修复从计数步骤测试,以计算方案作为JUnit测试改变会很快到来,但绑在小黄瓜3发力:
我能理解的是无人问津。对于我来说,它使用maven-surefire-plugin for 2.12版本,而不需要在上面描述的工作流程中做任何改变,但它出现在新版本的surefire插件中(2.18.1再次无效)。 – kadkaz
2.12的maven-surefire-plugin只能与junit并行使用。 2.18.1与testng一起工作没有问题。 – kadkaz