當我嘗試通過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