Jack
Jack

Reputation: 121

Allure: Jenkins Plugin is not able to generate report

Could you please help with the follow?

Running the protractor test.

Jenkins plugin is not able to generate report.

Error: 404 not found.

Allure plugin: 2.19

Allure commandline: 1.54

Protractor: 5.1.2

Jenkins is run locally: 2.60.1

NodeJS: 6.9.4

NPM: 4.0.5

Error stack trace: allure-report for the report is already in use, add a '--clean' option to overwrite.

Stack trace:

[11:56:19] I/launcher - 0 instance(s) of WebDriver still running
[11:56:19] I/launcher - chrome #01 failed 1 test(s)
[11:56:19] I/launcher - overall: 1 failed spec(s)
[11:56:19] E/launcher - Process exited with error code 1
npm ERR! Test failed.  See above for more details.
Build step 'Execute Windows batch command' marked build as failure
[protractor-allure-reporting-example] $ D:\Jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\allure-commandline\allure-2.2.1\bin\allure.bat generate 
D:\Jenkins\workspace\protractor-allure-reporting-example\first-result -o 
D:\Jenkins\workspace\protractor-allure-reporting-example\allure-report
Allure: Target directory D:\Jenkins\workspace\protractor-allure-reporting-
example\allure-report for the report is already in use, add a '--clean' option to overwrite
ERROR: Build step failed with exception ru.yandex.qatools.allure.jenkins.exception.AllurePluginException: Can not generate Allure Report, exit code: 1
at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:173)
at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:94)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:676)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:621)
at hudson.model.Run.execute(Run.java:1760)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:405)
Build step 'Allure Report' marked build as failure
Finished: FAILURE

Upvotes: 4

Views: 5048

Answers (3)

Rahul Saxena
Rahul Saxena

Reputation: 11

try to check that in the docker container where your allure report generated not able to detect java_home. So try to set your report path where your container ends and then your allure report will able to find java_home.

and able to generate report.

Use below command to check the same:

sh "/var/lib/.../ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/../bin/allure --version"

Upvotes: 0

Add it in package.json scripts

"posttest": "allure generate allure-results --clean -o allure-report || true && allure report open -o allure-report"

Upvotes: 0

Dmitry Baev
Dmitry Baev

Reputation: 2743

Seems like you need to clean your workspace before build. Or you can add one more step before report generation that will remove allure-report directory.

Upvotes: 4

Related Questions