Skip to content

Update Verify.XunitV3 to avoid invalid artifact paths#16632

Merged
eerhardt merged 5 commits intomicrosoft:mainfrom
radical:ankj/fix-artifact-upload-paths
May 1, 2026
Merged

Update Verify.XunitV3 to avoid invalid artifact paths#16632
eerhardt merged 5 commits intomicrosoft:mainfrom
radical:ankj/fix-artifact-upload-paths

Conversation

@radical
Copy link
Copy Markdown
Member

@radical radical commented May 1, 2026

Fixes #16638

Description

Updates Verify.XunitV3 from 31.1.0 to 31.16.2 so Verify no longer emits failed snapshot attachments with names that contain characters rejected by actions/upload-artifact.

We are updating this dependency because the pinned Verify.XunitV3 version is the source of the invalid artifact path. Version 31.1.0 names mismatch attachments as Verify snapshot mismatch: {path}. MTP writes that attachment name under testresults/**, so the colon in Verify 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.XunitV3 31.16.2 changed 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

Error

The path for one of the files in artifact is not valid: /testresults/_runnervmeorf1_2026-04-30_23_03_43.7907827/In/runnervmeorf1/Verify snapshot mismatch: _home_runner_work_aspire_aspire_tests_Aspire.Hosting.Azure.Tests_Snapshots_AzureDeployerTests.DeployAsync_WithFoundryAndAzureContainerApps_CreatesCorrectDependencies.received.txt.bin. Contains the following character:  Colon :

Invalid characters include:  Double quote ", Colon :, Less than <, Greater than >, Vertical bar |, Asterisk *, Question mark ?, Carriage return \r, Line feed \n

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):

  • With Verify.XunitV3 31.1.0, the generated TRX contains
    <ResultFile path=".../Verify snapshot mismatch: _..._received.txt.bin" /> — the colon-prefixed path that actions/upload-artifact rejects.
  • With Verify.XunitV3 31.16.2, the same test produces no mismatch: 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.

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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16632

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16632"

radical and others added 3 commits April 30, 2026 20:47
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>
@radical radical changed the title Sanitize test artifact paths before upload Update Verify to fix artifact attachment paths May 1, 2026
@radical radical changed the title Update Verify to fix artifact attachment paths Update Verify.XunitV3 to avoid invalid artifact paths May 1, 2026
@radical radical marked this pull request as ready for review May 1, 2026 01:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.XunitV3 from 31.1.0 to 31.16.2 in 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>
@radical radical requested a review from mitchdenny May 1, 2026 05:59
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

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.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

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.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

@eerhardt eerhardt merged commit 58f0b00 into microsoft:main May 1, 2026
849 of 855 checks passed
@github-actions github-actions Bot added this to the 13.4 milestone May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Upload logs step fails because Verify writes attachment file names containing ':'

3 participants