Issue
I want to generate a unified report by merging the results from two separate Jenkins maven projects (and I've read that Allure does support that feature - to merge results different allure-results folders), but it does not work properly as I'll explain below.
My objective is to have visibility from all tests results I've from all projects. Currently I can only see the test results specific to a project.
This is the context:
I've two Maven projects (for testNG
) running and reporting results via allure on JENKINS. As you can see below, the allure results from those two builds are working as expected - automatically generated by Allure Jenkins plugin version 2.26.0
Allure Jenkins plugin working fine for separate maven jobs
Now I've also installed the Allure 2.6.0 and added it on system PATH and properly configure ALLURE_HOME environment var.
So when I ran this command here:
allure serve "C:\Users\tester\workspace\scripts-qa\STF\allure-results" --host "127.0.0.1" --port "8081"
It works perfectly to report the results in my Allure-results from my IntelliJ, as you can see below.
Allure serve results from my local worspace
Now when I ran similar command as above one to generate a unified report by merging both reports I got in Jenkins - just the execution trend is been populated - but the total number of tests and its details are not as you can see below.
This is the command I'm executing to generate a unified report:
allure serve "C:\Users\tester\.jenkins\workspace\Regression2\allure-report" "C:\Users\tester\.jenkins\workspace\Regression1\allure-report" --host "127.0.0.1" --port "8081"
Allure problem when trying to merge reports from two separate jenkins projects
Could you please help me to figure out what is wrong here? Is that possible that allure binary cannot serve results generated by allure Jenkins plugin? If yes, what is the work around to fix that?
Thank you!! Jean.
Solution
I can see that you are trying to generate cumulative report from already generated reports, which is not correct - Allure needs raw allure-results
to generate report
As a workaround, you need
- Archive
allure-results
for each test execution job and attach it to build as artifact - Copy
allure-results
artifacts - Unzip it
- Build a report based on
allure-results
from artifacts
Below are code snippets for Pipeline job
Attach allure-results
as artefact:
zip archive: true, dir: "target/allure-results", glob: '', zipFile: "allure-results.zip"
Copy artefacts to another job:
copyArtifacts filter: 'allure-results.zip', optional: true, projectName: "Regression1", selector: lastCompleted(), target: "Regression1"
unzip dir: "Regression1", glob: '', zipFile: "Regression1/allure-results.zip"
...
Build report
allure serve Regression1 Regression2
Answered By - Dmitry Mayer