黄瓜报告缺少报告结果 - 报告未成功完成

时间:2018-02-06 10:17:27

标签: java selenium cucumber jenkins-pipeline cucumber-jvm

我使用Cucumber Reports插件在管道作业中获取黄瓜报告它之前工作正常,但现在我有这个错误:

[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步骤

1 个答案:

答案 0 :(得分:0)

可能有几种原因。

  1. 在jenkins文件中验证管道,在使用Cucumber Options指示功能路径时很有必要
  stage 'Run Test'
         script 
            {sh "mvn clean test -Dcucumber.options=\"src/test/resources/features/ --tags @YourTagName\""}
  1. 验证插件以在您的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 {

}