Vanare / behat-cucumber-formatter

http://vanare.com
MIT License
5 stars 23 forks source link

Incompatibility with cucumber-testresult-plugin? #19

Open grEvenX opened 6 years ago

grEvenX commented 6 years ago

Hi. I'm using the latest version of this library together with the latest version of https://github.com/jenkinsci/cucumber-testresult-plugin/. However, for a while now it has been failing to generate valid cucumber reports, due to the following error:

[CucumberReport] Preparing Cucumber Reports: 3.20.0
[CucumberReport] JSON report directory is ""
[CucumberReport] Copied 8 json files from workspace "/var/lib/jenkins/workspace/eature_fix_cucumber_reports-U3A4JCWFAZJWGTC7SFOGPL5AKKGB355IR3CSUZEYLIZR26MSX7FQ" to reports directory "/var/lib/jenkins/jobs/Myworkout/jobs/api-v2/branches/feature-fix-.nol4n1.mber-reports/builds/6/cucumber-html-reports/.cache"
[CucumberReport] Copied 0 properties files from workspace "/var/lib/jenkins/workspace/eature_fix_cucumber_reports-U3A4JCWFAZJWGTC7SFOGPL5AKKGB355IR3CSUZEYLIZR26MSX7FQ" to reports directory "/var/lib/jenkins/jobs/Myworkout/jobs/api-v2/branches/feature-fix-.nol4n1.mber-reports/builds/6/cucumber-html-reports/.cache"
[CucumberReport] Processing 1 json files:
[CucumberReport] /var/lib/jenkins/jobs/Myworkout/jobs/api-v2/branches/feature-fix-.nol4n1.mber-reports/builds/6/cucumber-html-reports/.cache/build/behat/behat_report.json
[CucumberReport] Missing report result - report was not successfully completed
[CucumberReport] Build status is left unchanged

When I try to view the report I get the following error message:

et.masterthought.cucumber.ValidationException: File '/var/lib/jenkins/jobs/Myworkout/jobs/api-v2/branches/feature-fix-.nol4n1.mber-reports/builds/6/cucumber-html-reports/.cache/build/behat/behat_report.json' is not proper Cucumber report!
    at net.masterthought.cucumber.ReportParser.parseForFeature(ReportParser.java:90)
    at net.masterthought.cucumber.ReportParser.parseJsonFiles(ReportParser.java:61)
    at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:88)
    at net.masterthought.jenkins.CucumberReportPublisher.generateReport(CucumberReportPublisher.java:301)
    at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:229)
    at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
    at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
    at hudson.security.ACL.impersonate(ACL.java:290)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `net.masterthought.cucumber.json.support.Argument` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('| name  | open_registration |
| MyGym | yes               |
| Pepsi | no                |')
 at [Source: (InputStreamReader); line: 1, column: 1107]

Most users of this plugin is probably using it through Jenkins and together with the https://github.com/jenkinsci/cucumber-testresult-plugin/. Anyone else having these issues?

grEvenX commented 6 years ago

Update and workaround for other people that might have issues: Using the fork at https://github.com/cawolf/behat-cucumber-formatter produces compatible JSON file which works.