jenkinsci / cucumber-reports-plugin

Jenkins plugin to generate cucumber-jvm reports
https://plugins.jenkins.io/cucumber-reports/
GNU Lesser General Public License v2.1
210 stars 232 forks source link

Reporting fails after update to the 3.10.0 #176

Closed JoeSSS closed 7 years ago

JoeSSS commented 7 years ago

Reports are failing in pipelines after new update. Pipeline v2.2; BlueOcean v1.1.4. p.s. Rollback to 3.9.0 helps

Stack trace:

java.lang.NullPointerException: Name is null
    at java.lang.Enum.valueOf(Enum.java:236)
    at net.masterthought.cucumber.sorting.SortingMethod.valueOf(SortingMethod.java:8)
    at net.masterthought.jenkins.CucumberReportPublisher.generateReport(CucumberReportPublisher.java:271)
    at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:219)
    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:49)
    at hudson.security.ACL.impersonate(ACL.java:260)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE
JoeSSS commented 7 years ago

Just checked. It fails also on the latest Pipeline and BlueOcean versions

kapoorlakshya commented 7 years ago

Yup, I get the same stack trace with v3.1.10. Using Pipeline v2.5 and Blue Ocean v1.2.0.

Rolling back to 3.9.0 fixed it.

tmair commented 7 years ago

There is no default set for the sorting method. A workaround for the issue is to set the sorting method.

E.g. in a pipeline script you could do the following:

step([$class: 'CucumberReportPublisher', jsonReportDirectory: '.test-results', fileIncludePattern: 'e2e-test-results.json', sortingMethod: 'NATURAL'])
JoeSSS commented 7 years ago

is there any documentation about the sorting methods possibilities and options? :)

tisoft commented 7 years ago

Maybe there is a better way, but at least #177 fixes the NPE for us and we don't need to change all our pipeline scripts with the workaround.

damianszczepanik commented 7 years ago

Thanks to @tisoft patch has been merged and patch was released