[release/v7.5] Refactor: Centralize xUnit tests into reusable workflow and remove legacy verification#26794
Conversation
…gacy verification (PowerShell#26243) Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: TravisEz13 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Backports the CI refactor that moves xUnit execution into a dedicated reusable GitHub Actions workflow for clearer, independently retriable test runs, and removes the legacy “verify xunit results” layer.
Changes:
- Added a reusable workflow (
xunit-tests.yml) that checks out, bootstraps, builds, runs xUnit, and uploads results. - Updated Linux/macOS/Windows CI workflows to call the reusable xUnit workflow and to gate “ready_to_merge” on it.
- Removed legacy xUnit verification/action wiring and added new instruction documents under
.github/instructions/.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/xunit-tests.yml | New reusable workflow job to build + run xUnit and upload xUnitTestResults.xml. |
| .github/workflows/windows-ci.yml | Replaces legacy xUnit verification job with reusable workflow call; updates ready_to_merge needs. |
| .github/workflows/macos-ci.yml | Replaces legacy xUnit verification job with reusable workflow call; updates ready_to_merge needs. |
| .github/workflows/linux-ci.yml | Replaces legacy xUnit verification job with reusable workflow call; updates ready_to_merge needs. |
| .github/actions/test/verify_xunit/action.yml | Removes legacy composite action that verified downloaded xUnit artifacts. |
| .github/actions/build/ci/action.yml | Removes in-build xUnit execution and xUnit artifact upload from the build action. |
| .github/instructions/workflow-prerequisites.md | Adds workflow guidance document (currently not in instruction-file format). |
| .github/instructions/troubleshooting-builds.md | Adds troubleshooting guidance document (currently not in instruction-file format). |
| .github/instructions/start-psbuild-basics.md | Adds Start-PSBuild guidance document (currently not in instruction-file format). |
| .github/instructions/git-requirements-for-builds.md | Adds git prerequisites guidance document (currently not in instruction-file format). |
| .github/instructions/build-configuration-guide.md | Adds build configuration guidance document (currently not in instruction-file format; also has a release-build example concern). |
| run: | | ||
| Import-Module ./tools/ci.psm1 |
There was a problem hiding this comment.
The “Build for Release” example calls Start-PSBuild -Configuration 'Release' without either switching NuGet sources or using -UseNuGetOrg. In this repo, Start-PSBuild only switches to public feeds when -UseNuGetOrg is set, otherwise it uses the default feeds; this example can fail in public CI/forks that don’t have access to internal feeds. Consider updating the example to either run Invoke-CIInstall/Switch-PSNugetConfig -Source Public beforehand or add -UseNuGetOrg to the Start-PSBuild invocation.
| run: | | |
| Import-Module ./tools/ci.psm1 | |
| run: | | |
| Import-Module ./build.psm1 | |
| Import-Module ./tools/ci.psm1 | |
| Switch-PSNugetConfig -Source Public |
| run: | | ||
| Import-Module ./tools/ci.psm1 | ||
| Invoke-CIInstall -SkipUser | ||
| Sync-PSTags -AddRemoteIfMissing |
There was a problem hiding this comment.
Invoke-CIInstall already runs Sync-PSTags -AddRemoteIfMissing (in tools/ci.psm1), so calling Sync-PSTags again here is redundant and adds an extra tag fetch. Consider removing the extra Sync-PSTags call and relying on Invoke-CIInstall for tag sync.
| Sync-PSTags -AddRemoteIfMissing |
| # Workflow Prerequisites for Building PowerShell | ||
|
|
||
| ## Required Steps Before Start-PSBuild | ||
|
|
There was a problem hiding this comment.
These files are under .github/instructions/, but they don’t follow the repo’s instruction-file format: instruction docs are expected to use the *.instructions.md suffix and begin with YAML frontmatter containing applyTo (see custom-instructions/repo/.github/instructions/instruction-file-format.instructions.md). As-is, this file is likely not picked up by the instruction tooling.
| # Troubleshooting Build Issues | ||
|
|
||
| ## Git Describe Error | ||
|
|
There was a problem hiding this comment.
These files are under .github/instructions/, but they don’t follow the repo’s instruction-file format: instruction docs are expected to use the *.instructions.md suffix and begin with YAML frontmatter containing applyTo (see custom-instructions/repo/.github/instructions/instruction-file-format.instructions.md). As-is, this file is likely not picked up by the instruction tooling.
| # Start-PSBuild Basics | ||
|
|
||
| ## Purpose | ||
|
|
There was a problem hiding this comment.
These files are under .github/instructions/, but they don’t follow the repo’s instruction-file format: instruction docs are expected to use the *.instructions.md suffix and begin with YAML frontmatter containing applyTo (see custom-instructions/repo/.github/instructions/instruction-file-format.instructions.md). As-is, this file is likely not picked up by the instruction tooling.
| # Git Requirements for Building PowerShell | ||
|
|
||
| ## Fetch Depth | ||
|
|
There was a problem hiding this comment.
These files are under .github/instructions/, but they don’t follow the repo’s instruction-file format: instruction docs are expected to use the *.instructions.md suffix and begin with YAML frontmatter containing applyTo (see custom-instructions/repo/.github/instructions/instruction-file-format.instructions.md). As-is, this file is likely not picked up by the instruction tooling.
| # Build Configuration Guide | ||
|
|
||
| ## Choosing the Right Configuration | ||
|
|
There was a problem hiding this comment.
These files are under .github/instructions/, but they don’t follow the repo’s instruction-file format: instruction docs are expected to use the *.instructions.md suffix and begin with YAML frontmatter containing applyTo (see custom-instructions/repo/.github/instructions/instruction-file-format.instructions.md). As-is, this file is likely not picked up by the instruction tooling.
Backport of #26243 to release/v7.5
Triggered by @daxian-dbw on behalf of @app/copilot-swe-agent
Original CL Label: CL-BuildPackaging
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
Centralizes xUnit tests into a reusable workflow for better retryability and clearer test results. Removes legacy verification layers and ensures test failures fail CI immediately.
Customer Impact
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
The refactored workflow was validated in CI with all xUnit tests running successfully. The reusable workflow has been tested across Linux, macOS, and Windows platforms.
Risk
REQUIRED: Check exactly one box.
This refactors xUnit test execution into a reusable workflow and removes legacy verification logic. It improves CI reliability and test retryability. The change has been tested in master and backported to 7.6 successfully.
Merge Conflicts
Resolved conflicts in CI workflow files (linux-ci.yml, macos-ci.yml, windows-ci.yml) by accepting the new xunit-tests workflow approach.