Update Verify.XunitV3 to avoid invalid artifact paths#16632
Update Verify.XunitV3 to avoid invalid artifact paths#16632eerhardt merged 5 commits intomicrosoft:mainfrom
Conversation
Rename CI artifact files and directories that contain characters rejected by actions/upload-artifact before uploading logs and test results. This preserves failed-test diagnostics when generated test artifacts contain names such as Verify snapshot mismatch paths with colons. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16632Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16632" |
Keep the sanitizer focused on replacing upload-artifact-invalid path characters and fail loudly if sanitizing would collide with an existing path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a shared TestRepoRoot helper for Infrastructure.Tests and document that agents should search for existing shared helpers before adding new private helpers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update Verify.XunitV3 to a version that no longer prefixes mismatch attachment names with 'Verify snapshot mismatch:'. This fixes upload-artifact failures caused by colon characters in generated test-result attachment paths without post-processing artifacts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the test-only snapshot testing dependency Verify.XunitV3 to prevent invalid snapshot attachment file names (containing :) from being written into testresults/**, which can cause actions/upload-artifact to reject uploaded artifacts in GitHub Actions runs.
Changes:
- Bump
Verify.XunitV3from31.1.0to31.16.2in test package central management. - Add agent guidance to prefer reusing/extending existing shared helpers (especially under
tests/Shared/) rather than creating new private helper utilities.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/Directory.Packages.props | Updates the centrally-managed test dependency version for Verify.XunitV3. |
| AGENTS.md | Adds an instruction encouraging reuse of existing shared helper implementations before adding new helpers. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
Fixes #16638
Description
Updates
Verify.XunitV3from31.1.0to31.16.2so Verify no longer emits failed snapshot attachments with names that contain characters rejected byactions/upload-artifact.We are updating this dependency because the pinned
Verify.XunitV3version is the source of the invalid artifact path. Version31.1.0names mismatch attachments asVerify snapshot mismatch: {path}. MTP writes that attachment name undertestresults/**, so the colon inVerify snapshot mismatch:becomes part of the file path. GitHub's artifact upload action then rejects the artifact because it enforces cross-platform filename restrictions.Verify.XunitV331.16.2changed this behavior to use a path-derived attachment name instead of the colon-prefixed display string, which fixes the artifact upload failure at the source instead of renaming generated files after the test run.Failure instance
ci.ymlrun 25192208839Tests / Hosting.Azure / Hosting.Azure (ubuntu-latest)Upload logs, and test resultsError
Validation
Reproduced and verified locally with a minimal xUnit v3 + Verify project (single test deliberately producing a snapshot mismatch, run through MTP with TRX reporting):
Verify.XunitV331.1.0, the generated TRX contains<ResultFile path=".../Verify snapshot mismatch: _..._received.txt.bin" />— the colon-prefixed path thatactions/upload-artifactrejects.Verify.XunitV331.16.2, the same test produces nomismatch:reference in the TRX, no in-process artifact with the colon-prefixed name, and no files containing:under the test results directory.This confirms the upgrade fixes the root cause rather than working around the symptom.