allure2
allure2 copied to clipboard
Error when generates a report - Allure Test Reports(Molecula) plugin - Azure Devops(VSTS)
Describe the bug I'm using this plugin for Allure https://marketplace.visualstudio.com/items?itemName=Molecula.allure-test-reports When Azure try to generate the report throws next errors
For Ubuntu
agent:
[command]/usr/local/bin/node /home/vsts/work/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb/1.0.0/node_modules/allure-commandline/bin/allure generate --output /home/vsts/work/1/s/allure-report/46 /home/vsts/work/1/s/allure-results
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn /home/vsts/work/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb/1.0.0/node_modules/allure-commandline/dist/bin/allure EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
throw er; // Unhandled 'error' event
^
Error: spawn /home/vsts/work/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb/1.0.0/node_modules/allure-commandline/dist/bin/allure EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
For Windows
agent:
[command]C:\Program Files\nodejs\node.exe D:\a\_tasks\AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb\1.0.0\node_modules\allure-commandline\bin\allure generate --output D:\a\1\s\allure-report\49 D:\a\1\s\allure-results
Command aborted due to exception {}.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:153)
at ru.yandex.qatools.allure.command.ReportGenerate.runUnsafe(ReportGenerate.java:48)
at ru.yandex.qatools.allure.command.AbstractCommand.run(AbstractCommand.java:52)
at ru.yandex.qatools.allure.CommandLine.main(CommandLine.java:46)
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:153)
at ru.yandex.qatools.allure.command.ReportGenerate.runUnsafe(ReportGenerate.java:48)
at ru.yandex.qatools.allure.command.AbstractCommand.run(AbstractCommand.java:52)
at ru.yandex.qatools.allure.CommandLine.main(CommandLine.java:46)
at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:58)
at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:53)
at ru.yandex.qatools.allure.AllureMain.main(AllureMain.java:48)
Exception in thread "main" ru.yandex.qatools.allure.data.ReportGenerationException: Could not find any allure results
at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:58)
at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:53)
at ru.yandex.qatools.allure.AllureMain.main(AllureMain.java:48)
To Reproduce Steps to reproduce the behavior:
-
Go to Azure Devops
-
Install Allure plugin https://marketplace.visualstudio.com/items?itemName=Molecula.allure-test-reports
-
Go to your Azure project according to your user/workspace.
-
Go to
Pipeline
section -
Create a new pipeline.
-
Setup a build with Ubuntu/Windows (according what error you need to reproduce) agent
-
Setup any project to generate results (In this case Maven/Java project)
-
Setup sheel script for Ubuntu agent to verify files in
allure-results
directory (use CMD for Windows) -
Setup allure plugin to take
allure-results
directory to generate a report. -
Run pipeline
Expected behavior When pipeline finished (failed or not), it should generate Allure report files.
Screenshots
Error for Ubuntu
Verifying if allure-results
directory exists and if it contains files results.
Stack trace when Allure plugin is trying to generate a report.
Error for Windows
Verifying if allure-results
directory exists and if it contains files results.
Stack trace when Allure plugin is trying to generate a report.
Facing the same issue. Do we have any updates?
@MegalaRajendran seems to be nobody is maintaining this plugin.
I have another solution for you. You could start up an Allure docker container in your server (Allure Docker Service: https://github.com/fescobar/allure-docker-service ) and you could send your results from AzureDevops to that container through API.
https://github.com/fescobar/allure-docker-service#send-results-through-api
@fescobar Thanks for the workaround. Will Try . Hope this solves
Hi Team,
Allure Test Reports plugin is not working on Azure, i am getting below error. Could you please look into it?
I have checked C:\agent_work\2\s\target\allure-results contains multiple files
2020-02-12T09:42:21.9156093Z ##[section]Starting: Generate Allure Report 2020-02-12T09:42:22.0589528Z ============================================================================== 2020-02-12T09:42:22.0589617Z Task : Generate Allure Report 2020-02-12T09:42:22.0589645Z Description : Generates Allure report based on the test results 2020-02-12T09:42:22.0589673Z Version : 1.0.0 2020-02-12T09:42:22.0589697Z Author : Molecula 2020-02-12T09:42:22.0589727Z Help : More Information 2020-02-12T09:42:22.0589752Z ============================================================================== 2020-02-12T09:42:22.9191463Z [command]C:\Program Files\nodejs\node.exe C:\agent_work_tasks\AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb\1.0.0\node_modules\allure-commandline\bin\allure generate --output C:\agent_work\2\s\allure-report\20200212.10 C:\agent_work\2\s\target\allure-results 2020-02-12T09:42:26.9963352Z Command aborted due to exception {}.
2020-02-12T09:42:26.9963671Z Exception in thread "main" ru.yandex.qatools.allure.data.ReportGenerationException: Could not find any allure results
2020-02-12T09:42:26.9963753Z org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
2020-02-12T09:42:26.9963833Z at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:58) 2020-02-12T09:42:26.9963900Z at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404) 2020-02-12T09:42:26.9964290Z at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:53) 2020-02-12T09:42:26.9964350Z at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166) 2020-02-12T09:42:26.9964634Z at ru.yandex.qato
@stambecg Nobody is maintaining this plugin.
@fescobar Could you help me with advice on best way to attach a report to each azure work through ALLURE DOCKER SERVICE. Thanks for your work
@Garynychxxx Allure Docker Service exposes an API. For example, you can send results from anywhere even from Azure. You can deploy 1 or multiple allure docker containers, it's up to you. But this solution is outside of Azure, you have to have your own infrastructure.
Another option is to run allure docker command in azure including your results to generate the emailable report https://github.com/fescobar/allure-docker-service#customize-emailable-report, after that you should stop the container.
You have multiple ways to use that container, it's up to you what is the best way in your case. You have all the documentation here https://github.com/fescobar/allure-docker-service
@Garynychxxx Allure Docker Service exposes an API. For example, you can send results from anywhere even from Azure. You can deploy 1 or multiple allure docker containers, it's up to you. But this solution is outside of Azure, you have to have your own infrastructure.
Another option is to run allure docker command in azure including your results to generate the emailable report https://github.com/fescobar/allure-docker-service#customize-emailable-report, after that you should stop the container.
You have multiple ways to use that container, it's up to you what is the best way in your case. You have all the documentation here https://github.com/fescobar/allure-docker-service
Yep thanks, But as I understand it is impossible to create individual report for each job . Something like this.....
@Garynychxxx Use a different port for a different group of tests or categorize your tests.
@fescobar
Is your project intended for local use only? I tried to run it on azure and could not open the API.
http://alluressreport.azurewebsites.net/index.html
@Garynychxxx you can use it from everywhere, even from kubernetes. You need to expose the API (use different port, by default 5050). Read the doc https://github.com/fescobar/allure-docker-service#allure-api 4040 is for Allure UI 4040 is for Allure API
ports:
- "4040:4040"
- "5050:5050"
Same issues as orginally posted. Does this plugin ever works ? I copied results through script to allure-reports/buildId folder. still dont see allure showing reports on the finished build pipeline
Same issue seen as in the original post. :(
Here is the fix. There are two ways depending on agent you are using.
- Use Azure Pipelines - vs2017-win2016 agent
- Use any Linux agent (Azure Pipelines Ubuntu or self hosted) with extra task before creating Allure Report
chmod 755 $(Agent.WorkFolder)/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacf1/1.0.0/node_modules/allure-commandline/dist/bin/allure
As described above on Pipeline add an extra task (Bash) before creating Allure Report and add these lines
sed -i 's/allure-commandline.*/allure-commandline\": \">=2.13.8",/' $(Agent.WorkFolder)/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb/1.0.0/package.json
cd $(Agent.WorkFolder)/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb/1.0.0/ && npm update
chmod -R 777 $(Agent.WorkFolder)/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb/1.0.0/
chmod 755 $(Agent.WorkFolder)/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb/1.0.0/node_modules/allure-commandline/dist/bin/allure
If something is not working check Dir is exists( i mean AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb)!
Here is the fix. There are two ways depending on agent you are using.
- Use Azure Pipelines - vs2017-win2016 agent
- Use any Linux agent (Azure Pipelines Ubuntu or self hosted) with extra task before creating Allure Report
chmod 755 $(Agent.WorkFolder)/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacf1/1.0.0/node_modules/allure-commandline/dist/bin/allure
chmod
resolves the original issue in this post.
But then ran into another error "Unknown Test Runner" as reported in #880
From the log, it says report has been successfully generated before displaying "Unknown Test Runner" error
Report successfully generated to the directory </Users/xxxx/myagent/_work/51/s/e2e/reports/allure/reports/>. Use 'allure report open' command to show the report
. Custom paths were specified instead of using default ones btw.
Will someone fix this issue?
@ElkRom I don't think so.
Any update on above issue ?
Hey, are will still without standard solution? :(
@MikhailTamarinFlipdish Can you please guide if below is correct? I am getting an error as no such file or dir.

@MikhailTamarinFlipdish Can you please guide if below is correct? I am getting an error as no such file or dir.
![]()
find $(Agent.WorkFolder)/_tasks/ -name allure -type f -exec chmod 755 {} \;
This is the command we are executing before AllureGenerate task. Works like a charm.
@MikhailTamarinFlipdish Thanks, the bash job worked but now getting a different error for generating the report. Looks like i am pretty close.
This is how I am generating report via script in package.json file
"generate": "allure generate --clean allure-results"
Pipeline
# Script to run the automation tests
- script: |
ENV=${{ parameters.environment }} npm run test
npm run generate
if [ $? -ne 0 ]; then
exit 1
displayName: 'Run Tests'
# Copy the target folder to Azure Pipelines
- task: CopyFiles@2
condition: succeededOrFailed()
inputs:
Contents: 'allure-report/**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
# Publish build artifacts to Azure Pipelines
- task: PublishPipelineArtifact@1
condition: succeededOrFailed()
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
publishLocation: 'pipeline'
- task: Bash@3
condition: succeededOrFailed()
inputs:
targetType: 'inline'
script: chmod 755 $(Agent.WorkFolder)/_tasks/AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb/1.0.0/node_modules/allure-commandline/dist/bin/allure
# Publish Allure report to Azure Pipelines
- task: AllureGenerate@1
condition: succeededOrFailed()
inputs:
resultsDir: 'allure-results'
targetDir: 'allure-report/$(Build.BuildNumber)'

@MikhailTamarinFlipdish Can you please confirm if your report is generated at this URL as there is a difference of path and I think that is why the report is not getting generated.

see https://github.com/allure-framework/allure2/issues/1140
Official Allure extension for Azure Pipelines are now available https://marketplace.visualstudio.com/items?itemName=qameta.allure-azure-pipelines
History isn't yet supported, but we'll get there! Please submit feedback to our discussions