Cucumber Report Missing report result - report was not successfully completed

£可爱£侵袭症+ 提交于 2019-12-22 14:03:04

问题


I use Cucumber Reports plugin to get cucumber reports in pipeline jobs it works fine before but now i have this error:

[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

And if i run only some features the reports generate without any issue, i have this issue only if i run all features

for information i have about 15 feature with +2000 steps


回答1:


It can be for several reasons.

  1. verify your pipeline, in the jenkinsfile, it is necessary when using the Cucumber Options indicate the path of the features
  stage 'Run Test'
         script 
            {sh "mvn clean test -Dcucumber.options=\"src/test/resources/features/ --tags @YourTagName\""}
  1. Verify plugin to use cucumber report in your JenkinsFile always put that inside "Finally"
      finally {
                           cucumber buildStatus: "UNSTABLE", 
                           fileIncludePattern: "**/cucumber.json",
                           jsonReportDirectory: 'target'
                            }

Example 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 {

}


来源:https://stackoverflow.com/questions/48640543/cucumber-report-missing-report-result-report-was-not-successfully-completed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!