A flexible lightweight multi-language test report tool with the possibility to add steps, attachments, parameters and so on.
@dzmitrytesting you have to install allure in your jenkins master. Check Configuration> Tools
@KarthikManjrakar the server changed. Use the url https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.14.0/allure-commandline-2.14.0.zip
Hi everyone. Trying to add allure reporter to Jenkins pipeline but faced with the following error (above)
I have added it to global tools installer from maven central (not url, just version from dropdown)
here is mine pipeline:
stage('Save report') {
steps {
stash includes: 'reports/allure-results/**', name: 'reports'
}
}
}
post {
always {
dir('test') {
unstash 'reports'
}
// sh 'which allure'
// sh 'npm install -g allure-comandline'
// sh 'which allure'
sh 'chmod 777 test/reports/allure-results'
script {
allure results: [[path: 'test/reports/allure-results']]
}
}
}
@fescobar also tried to set up this url in configuration
allure --version
/var/lib/jenkins/workspace/....@tmp/durable-c5c5e24b/script.sh: 1: /var/lib/jenkins/workspace/....@tmp/durable-c5c5e24b/script.sh: allure: not found
interesting. It's not able.
Just additional thing that agent is:
agent {
dockerfile {
args '-u root:root'
}
}
maybe your POSTcode is wrong. Check this one as stage
stage('Generating Reports'){ steps { allure([ includeProperties: false, jdk: '', properties: [], reportBuildPolicy: 'ALWAYS', results: [[path: "test/reports/allure-results"]] ]) } }
try that removing your post block just in case
maybe your POSTcode is wrong. Check this one as stage
stage('Generating Reports'){ steps { allure([ includeProperties: false, jdk: '', properties: [], reportBuildPolicy: 'ALWAYS', results: [[path: "test/reports/allure-results"]] ]) } }
try using that please
[Pipeline] dir
Running in /var/lib/jenkins/workspace/…/test
[Pipeline] {
[Pipeline] unstash
[Pipeline] }
[Pipeline] // dir
[Pipeline] sh
+ chmod 777 test/reports/allure-results
[Pipeline] allure
docker exec --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** --env ******** bc9430053d95d841aee77da957ad4d5b0b7cf81a82530863383759df2a8df07d /var/lib/jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure/allure-2.14.0/bin/allure generate /var/lib/jenkins/workspace/…/test/reports/allure-results -c -o /var/lib/jenkins/workspace/…./allure-report
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "/var/lib/jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure/allure-2.14.0/bin/allure": stat /var/lib/jenkins/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure/allure-2.14.0/bin/allure: no such file or directory: unknown
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
$ docker stop --time=1 bc9430053d95d841aee77da957ad4d5b0b7cf81a82530863383759df2a8df07d
$ docker rm -f bc9430053d95d841aee77da957ad4d5b0b7cf81a82530863383759df2a8df07d
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ru.yandex.qatools.allure.jenkins.exception.AllurePluginException: Can not generate Allure Report, exit code: 126
at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:314)
at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:231)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:99)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:69)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Jenkins not tried to get new version which i put to configuration
maybe your POSTcode is wrong. Check this one as stage
stage('Generating Reports'){ steps { allure([ includeProperties: false, jdk: '', properties: [], reportBuildPolicy: 'ALWAYS', results: [[path: "test/reports/allure-results"]] ]) } }
just add that stage and show me
java.nio.file.AccessDeniedException: /var/lib/jenkins/workspace/.../reports/allure-results/testrun.json