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

Can not generate cucumber report in jenkins #156

Closed shohilbagdai closed 7 years ago

shohilbagdai commented 7 years ago

hi after installing plugin on jenkins I am trying generate report but some how its not working, this is my cucumber runner class @CucumberOptions(features = "src/test/resources/feature", plugin = { "json:target/cucumber.json", "html:target/site/cucumber-pretty" }),

in jenkins configuration report path = target File Include Pattern = cucumber.json

but getting below error and cucumber report not generation

any idea?

[CucumberReport] Preparing Cucumber Reports ERROR: Publisher 'Cucumber reports' aborted due to exception: java.lang.NoSuchMethodError: org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(Lhudson/model/Run;Lhudson/FilePath;Lhudson/model/TaskListener;Ljava/lang/String;)Ljava/lang/String; at net.masterthought.jenkins.CucumberReportPublisher.evaluateMacro(CucumberReportPublisher.java:255) at net.masterthought.jenkins.CucumberReportPublisher.generateReport(CucumberReportPublisher.java:131) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:112) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:75) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671) at hudson.model.Run.execute(Run.java:1769) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374) [description-setter] Description set:

thanks

damianszczepanik commented 7 years ago

Looks like problem between Jenkins and plugin, not plugin itself. Have you tried install again?

shohilbagdai commented 7 years ago

Thanks for reply damian, I tried after reinstalling but same issue. Am I giving path right?

mpkorstanje commented 7 years ago

Plenty of Google hits for this error. This is a problem with Token Macro. It appears your Jenkins has the wrong version of it. You need to update your Jenkins.

damianszczepanik commented 7 years ago

@mpkorstanje thank your for this solution

shahnawazm786 commented 11 months ago

net.masterthought.cucumber.ValidationException: File 'C:\ProgramData\Jenkins.jenkins\jobs\Weekly_Batch_Demo_Batch\builds\2\cucumber-html-reports_444c1e78-b67b-341f-abcb-29a7a6cd5509.cache\src\test\resources\Apps_Data\Data.json' is not a valid Cucumber report! at net.masterthought.cucumber.ReportParser.parseForFeature(ReportParser.java:104) at net.masterthought.cucumber.ReportParser.parseJsonFiles(ReportParser.java:72) at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:97) at net.masterthought.jenkins.CucumberReportPublisher.generateReport(CucumberReportPublisher.java:563) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:434) at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711) at hudson.model.Run.execute(Run.java:1925) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442)