ci: show all OS test results in merged Allure report - #2486
Merged
Conversation
The merged Allure report previously showed only Windows metadata at the
top level. Per-OS test result JSON files were merged correctly (UUID-named,
no collision), but the fixed-name 'environment.properties' written by each
matrix job collided during 'download-artifact: merge-multiple: true' — the
last extracted file (Windows, alphabetically) won and overwrote the others.
Allure already supports the multi-launch pattern natively: pass multiple
results directories to 'allure generate' and the report aggregates the
Environment widget keys across launches and shows one row per launch in the
Executors widget. The only thing breaking that today was the flattening
download.
Changes:
- build.gradle: 'allureRawResultElements' is now configurable via the
'-PallureMergeDirs=dir1,dir2,...' project property. The default (single
'build/allure-results' dir) is unchanged for per-job runs.
- build.gradle: 'generateAllureEnvironment' also writes an 'executor.json'
per job (name, type=github, buildName, buildUrl, buildOrder) so the
Executors widget on the merged report links back to each matrix job.
- step-ci-build.yml: 'merge-test-reports' now downloads each per-OS
artifact into its own subdir (no 'merge-multiple') and passes them to
'allureReport' via '-PallureMergeDirs'.
Net result on the merged report:
- Environment widget: 'OS' aggregates across launches (e.g.
'Linux amd64, Mac OS X aarch64, Windows 10 amd64'); shared keys
('GitCommit', 'ProjectVersion', 'CI') collapse to one entry.
- Executors widget: one row per matrix cell with link back to the job.
Contributor
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The merge-test-reports job had a duplicate-generation bug: my explicit
'gradle allureReport -PallureMergeDirs=...' step generated the report
correctly, then shared-test-archiving's own 'gradle allureReport --clean'
re-ran without the property, fell back to the non-existent
build/allure-results dir, and the --clean wiped the previously generated
report — leaving index.html upload to fail with 'No files were found'.
Fix: drop the explicit generate-report step and instead set
ORG_GRADLE_PROJECT_allureMergeDirs in $GITHUB_ENV before the archiving
step. Gradle automatically reads ORG_GRADLE_PROJECT_* as -P properties,
so shared-test-archiving's internal allureReport picks up the multi-dir
input on its only invocation.
Also: explicit empty suffix on the archiving call (was '${{ matrix.os }}'
which evaluates to empty in this non-matrix job — clearer this way).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: allure merge in main only show windows because environemnt.properties collide when merging. this moves to utilize allure's default support for handling multiple test runs by passing multiple dirs.
p.s. would NEVER or at least in any sane time have figured this out without a research agent :)
Why
The merged Allure report on
mainbuilds currently shows only Windows metadata at the top level (Environment widget). Mac/Linux test data is actually present (UUID-named result JSONs do not collide), but everything humans see on the overview page comes from a singleenvironment.propertiesfile — and during artifact merge the Windows copy overwrote Ubuntu's and macOS's.Root cause
download-artifactwithmerge-multiple: trueflattens every per-OS artifact into one directory. Fixed-name files (environment.properties,executor.json, etc.) collide; alphabetically Windows is last and wins. This also destroyed the per-launch boundary Allure uses to aggregate metadata across multiple runs.Fix
Allure already supports this scenario natively:
allure generatetakes multiple results directories and treats each as a separate "launch". The Environment widget aggregates keys across launches (e.g.OS → Linux amd64, Mac OS X aarch64, Windows 10 amd64) and the Executors widget shows one row per launch.build.gradle—allureRawResultElementsis now configurable via-PallureMergeDirs=dir1,dir2,.... Default (singlebuild/allure-results) unchanged for per-job runs.build.gradle—generateAllureEnvironmentalso writes anexecutor.jsonper job (name,type: github,buildName,buildUrl,buildOrder) so the Executors widget links back to each matrix job..github/workflows/step-ci-build.yml—merge-test-reportsnow downloads each per-OS artifact into its own subdir (nomerge-multiple) and passes them toallureReportvia-PallureMergeDirs.Net diff: +26 / -4 across two files.
What you'll see on the merged report after this PR
OSaggregates across launches; shared keys (GitCommit,ProjectVersion,CI) collapse to one entry.Verification
Locally simulated 3-OS merge: confirmed the embedded
environment.jsonaggregates OS values andexecutors.jsoncontains three executor entries. CI run on this PR will be the real check — open the Merged Allure Report link from the test-results-summary step summary.How to verify on this PR
ci-buildworkflow to finish.Background research
Allure 2's intended pattern for cross-host reports is "pass multiple dirs to
allure generate". SeeAllure1EnvironmentPlugin(groups env keys across launches),ExecutorPlugin(one entry per launch dir), andAllureReport.ktin the gradle plugin (passes everyrawResultsentry as a separate CLI arg).