Skip to content

[release/v7.5] Refactor: Centralize xUnit tests into reusable workflow and remove legacy verification#26794

Merged
daxian-dbw merged 1 commit intoPowerShell:release/v7.5from
daxian-dbw:backport/release/v7.5/26243-90e9159cb
Feb 12, 2026
Merged

[release/v7.5] Refactor: Centralize xUnit tests into reusable workflow and remove legacy verification#26794
daxian-dbw merged 1 commit intoPowerShell:release/v7.5from
daxian-dbw:backport/release/v7.5/26243-90e9159cb

Conversation

@daxian-dbw
Copy link
Member

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

  • Required tooling change
  • Optional tooling change (include reasoning)

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

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

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.

  • High
  • Medium
  • Low

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.

…gacy verification (PowerShell#26243)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: TravisEz13 <[email protected]>
@daxian-dbw daxian-dbw requested a review from a team as a code owner February 12, 2026 19:23
Copilot AI review requested due to automatic review settings February 12, 2026 19:23
@daxian-dbw daxian-dbw added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Feb 12, 2026
Copy link
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

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

Comment on lines +35 to +36
run: |
Import-Module ./tools/ci.psm1
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
run: |
Import-Module ./tools/ci.psm1
run: |
Import-Module ./build.psm1
Import-Module ./tools/ci.psm1
Switch-PSNugetConfig -Source Public

Copilot uses AI. Check for mistakes.
run: |
Import-Module ./tools/ci.psm1
Invoke-CIInstall -SkipUser
Sync-PSTags -AddRemoteIfMissing
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
Sync-PSTags -AddRemoteIfMissing

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
# Workflow Prerequisites for Building PowerShell

## Required Steps Before Start-PSBuild

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
# Troubleshooting Build Issues

## Git Describe Error

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
# Start-PSBuild Basics

## Purpose

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
# Git Requirements for Building PowerShell

## Fetch Depth

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
# Build Configuration Guide

## Choosing the Right Configuration

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@daxian-dbw daxian-dbw merged commit 9c8e9eb into PowerShell:release/v7.5 Feb 12, 2026
41 of 43 checks passed
@daxian-dbw daxian-dbw deleted the backport/release/v7.5/26243-90e9159cb branch February 12, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants