我使用 Cucumber Reports 插件在管道作业中获取 Cucumber 报告,以前工作正常,但现在出现此错误:
[CucumberReport] Preparing Cucumber Reports
[CucumberReport] JSON report directory is "target/"
[CucumberReport] Copied 1 json files from workspace "c:/jenkins/workspace/..." to reports directory "/var/jenkins_home/jobs/..."
[CucumberReport] Copied 0 properties files from workspace "c:/jenkins/workspace/..." to reports directory "/var/jenkins_home/jobs/..."
[CucumberReport] Processing 1 json files:
[CucumberReport] /var/jenkins_home/jobs/.../cucumber.json
[CucumberReport] Missing report result - report was not successfully completed
[CucumberReport] Build status is left unchanged
如果我只运行报告生成的某些功能而没有任何问题,则仅当我运行所有功能时才会出现此问题
作为信息,我有大约 15 个功能,+2000 个步骤
这可能有几个原因。
- 验证你的管道,在jenkins文件中,使用Cucumber选项时需要指明该功能的路径
stage 'Run Test'
script
{sh "mvn clean test -Dcucumber.options=\"src/test/resources/features/ --tags @YourTagName\""}
- 验证插件以在 JenkinsFile 中使用黄瓜报告,始终将其放入“最后”
finally {
cucumber buildStatus: "UNSTABLE",
fileIncludePattern: "**/cucumber.json",
jsonReportDirectory: 'target'
}
示例 RunTest.java
package runner;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(plugin = { "pretty", "json:target/cucumber.json" }, features = {
"src/test/resources/features/" }, glue = { "classpath:" }, tags = { "@YourTagName" })
public class RunTest {
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)