Pass attempt label to JUnit output to distinguish test retries#2209
Pass attempt label to JUnit output to distinguish test retries#2209michelle-clayton-work merged 9 commits intomicrosoft/mainfrom
Conversation
4d6827e to
ea7101d
Compare
GitHub quirk: if you put this in a list (without changing anything else), GitHub grabs the issue title. I do this basically always--more immediately readable and makes it obvious when I've grabbed the wrong issue.
|
e5e2a77 to
37c661c
Compare
37c661c to
6b8ae68
Compare
6b8ae68 to
e4aaf43
Compare
Add -attempt and -jobattempt flags to run-builder, passed through to json2junit. This distinguishes test results along two retry dimensions: - System.JobAttempt (AzDO job-level rerun): passed as -jobattempt - retryAttempts loop (in-job test retry): passed as -attempt All retry attempts are published in a single test run with title: 'linux-amd64 test (ubuntu) (job attempt 2)' Suite names inside the XML distinguish retries: 'cmd/go [job attempt 2, retry 3]' Includes a temporary forced flake on attempt 1 for testing retry visibility (marked with TODO for removal). Fixes: #2134
e9de3e8 to
d4760ed
Compare
d4760ed to
1ccccbc
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves Azure DevOps test result reporting for retried test runs by ensuring each retry produces distinct JUnit output and by passing a CI attempt label through to the JUnit converter (via updated go-infra support).
Changes:
- Emit per-retry JUnit XML files (
TestResults-attempt-*.xml) and publish them via wildcard. - Pass a CI attempt label (
-jobattempt, currently wired to$(System.StageAttempt)) throughrun-builderintojson2junitoptions. - Bump
github.com/microsoft/go-infradependency to pick up Attempt/JobAttempt support injson2junit.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| eng/pipeline/stages/run-stage.yml | Write unique JUnit XML per retry attempt; publish all attempt files; pass CI attempt label; adjust artifact naming/title. |
| eng/_util/buildutil/testjson.go | Add -jobattempt flag and forward it into json2junit options. |
| eng/_util/go.mod | Update go-infra dependency version. |
| eng/_util/go.sum | Update go-infra checksums for the new version. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
/azp help |
Supported commands
See additional documentation. |
|
/azp where |
|
Azure DevOps orgs getting events for this repository: |
dagood
left a comment
There was a problem hiding this comment.
Do you have a test run with a simulated failure showing what job/stage attempts look like with this change? I'm not quite sure how it'll show up, and why/when to use jobattempt vs. testRunTitle.
e9e14f9 to
da97858
Compare
da97858 to
01314bc
Compare
7914c07 to
90db8ad
Compare

Followup PR to microsoft/go-infra#449
This ensures test result entries in AzDO distinguish which attempt they correspond to, both via unique file names and via the attempt label embedded in JUnit test suite names.
Fixes: #2134