【问题标题】:Cucumber Report Missing report result - report was not successfully completed黄瓜报告缺少报告结果 - 报告未成功完成
【发布时间】:2018-07-16 08:52:57
【问题描述】:

我使用 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 步

【问题讨论】:

  • 请在生成新报告之前删除文件或黄瓜报告。你在用漂亮的格式吗?
  • @BostonStar 是的,这是我的班级跑者@RunWith(Cucumber.class) @CucumberOptions(features = "src/test/java/features", glue = {"steps"}, plugin = {"pretty", "html:target/cucumber", "json:target/cucumber.json"}) public class RunFeaturesTest {}
  • 我尝试在运行测试之前删除黄瓜报告,但我遇到了同样的问题
  • 请确保您有正确的路径,因为这也可能导致此错误。请记住,每个运行器文件都应该有唯一的 json 名称,该名称应该基于特征文件名,否则它会覆盖值

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


【解决方案1】:

可能有多种原因。

  1. 验证你的管道,在 jenkinsfile 中,使用 Cucumber Options 时需要指明特征的路径
  stage 'Run Test'
         script 
            {sh "mvn clean test -Dcucumber.options=\"src/test/resources/features/ --tags @YourTagName\""}
  1. 验证插件以在 JenkinsFile 中使用黄瓜报告始终将其放在“Finally”中
      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 {

}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-27
    • 2018-11-25
    • 2021-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-27
    相关资源
    最近更新 更多