Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while generating report #160

Closed
dnyaneshginde opened this issue Apr 27, 2016 · 7 comments
Closed

Error while generating report #160

dnyaneshginde opened this issue Apr 27, 2016 · 7 comments

Comments

@dnyaneshginde
Copy link

Hello,

I am getting the following exception while generating the report.
cucumber reports plugin version 2.0.0
jenkins version 1.516

The version of commons-io in my test project pom is 2.4 and i can see that the plugin also uses the same.
Can you please let me know what is wrong?

FATAL: org.apache.commons.io.FileUtils.copyInputStreamToFile(Ljava/io/InputStream;Ljava/io/File;)V
java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.copyInputStreamToFile(Ljava/io/InputStream;Ljava/io/File;)V
at net.masterthought.cucumber.ReportBuilder.copyResources(ReportBuilder.java:84)
at net.masterthought.cucumber.ReportBuilder.copyStaticResources(ReportBuilder.java:60)
at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:50)
at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:134)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:960)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1601)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:486)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:241)

@damianszczepanik
Copy link
Owner

I have no idea and information you provided are not very helpful

@dnyaneshginde
Copy link
Author

I think the cucumber plugin version 2.0.0 is not compatible with jenkins 1.516. So i downgraded the version of the cucumber reports plugin to 0.2.0. The other jars i am using in my pom are
cucumber-core 1.2.0
cucumber-html 0.2.3
cucumber-java 1.2.0
cucumber-junit 1.2.0
cucumber-jvm-deps 1.0.3

Now i am getting the following exception while generating the report:

[CucumberReportPublisher] Generating HTML reports
[CucumberReportPublisher] there was an error generating the reports: java.lang.NullPointerException
net.masterthought.cucumber.ReportBuilder.getBuildStatus(ReportBuilder.java:199)
net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:142)
hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:960)
hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
hudson.model.Run.execute(Run.java:1601)
hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:486)
hudson.model.ResourceController.execute(ResourceController.java:88)
hudson.model.Executor.run(Executor.java:241)
Build step 'Publish cucumber results as a report' changed build result to FAILURE
Finished: FAILURE

@dnyaneshginde
Copy link
Author

FYI...There is only one json file produced in the target directory and it is valid as i checked it

@dnyaneshginde
Copy link
Author

Please find the json below:

[
{
"id": "date-validation-on-transactions",
"description": "",
"name": "Date validation on transactions",
"keyword": "Feature",
"line": 1,
"elements": [
{
"id": "date-validation-on-transactions;1-opt-trades-with-all-expirydate-before-settlementdate.",
"description": "",
"name": "1 opt trades with all ExpiryDate before SettlementDate.",
"keyword": "Scenario",
"line": 3,
"steps": [
{
"result": {
"duration": 4365812000,
"status": "passed"
},
"name": "a clean database",
"keyword": "Given ",
"line": 5,
"match": {
"location": "SRFileUploadStepdefs.a_clean_database()"
}
},
{
"result": {
"duration": 7604000,
"status": "passed"
},
"name": "I have All SR Roles package and account mode",
"keyword": "And ",
"line": 7,
"match": {
"location": "DateValidationStepdefs.i_have_All_SR_Roles_package_and_account_mode()"
}
},
{
"result": {
"duration": 1219016000,
"status": "passed"
},
"name": "I send below file on SR.FILE.UPLOAD",
"keyword": "When ",
"line": 9,
"match": {
"location": "UploadUtilsStepdefs.I_send_below_file_on_FileUpload_Queue(FeatureParams\u003e)"
},
"rows": [
{
"cells": [
"fileFormat",
"fileName",
"filePath"
],
"line": 10
},
{
"cells": [
"Excel",
"Excel_ExpiryDate_TEST.xlsx",
"/com/sr/sds/test/excel/"
],
"line": 11
}
]
},
{
"result": {
"duration": 3863486000,
"status": "passed"
},
"name": "the transaction should have no errors",
"keyword": "Then ",
"line": 14,
"match": {
"location": "DateValidationStepdefs.the_transaction_should_have_no_error(FeatureParams\u003e)"
},
"rows": [
{
"cells": [
"custRefNumber",
"accountCode"
],
"line": 15
},
{
"cells": [
"GHERXT-OPT-01",
"000001"
],
"line": 16
}
]
},
{
"result": {
"duration": 4777771000,
"status": "passed"
},
"name": "a clean database",
"keyword": "Then ",
"line": 18,
"match": {
"location": "SRFileUploadStepdefs.a_clean_database()"
}
}
],
"type": "scenario"
}
],
"uri": "features/com/sr/sds/sdt/validation/date/DateValidationScenarios.feature"
}
]

@damianszczepanik
Copy link
Owner

I can generate report from above JSON. Don't downgrade because older versions are not supported

@joshiradhika
Copy link

I am also facing the NullPointerException issue with version 0.0.23 with jenkins version 1.516.
Can you please tell me which version of cucumber report plugin works with jenkins 1.516?

@dnyaneshginde
Copy link
Author

dnyaneshginde commented Apr 27, 2016

@damianszczepanik Version 2.0.0 of the plugin with jenkins 1.516 gives the exception in my original post.
FATAL: org.apache.commons.io.FileUtils.copyInputStreamToFile(Ljava/io/InputStream;Ljava/io/File;)V
java.lang.NoSuchMethodError:

I am not in a position to upgrade the jenkins version since it is shared across projects.
Can you please let me know what is the issue with version 2.0.0 with jenkins 1.516?
Is there a workaround because neither version 0.0.23 nor version 2.0.0 is working for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants