Skip to content

Reduce Windows PR validation time: Helix, parallel test collections, pwsh#703

Draft
Copilot wants to merge 20 commits into
mainfrom
copilot/optimize-windows-pr-validation
Draft

Reduce Windows PR validation time: Helix, parallel test collections, pwsh#703
Copilot wants to merge 20 commits into
mainfrom
copilot/optimize-windows-pr-validation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

  • Switch powershell.exepwsh in DotNetCommand.cs
  • Create InstallScriptTestBase.cs abstract base class
  • Refactor GivenThatIWantToInstallDotnetFromAScript.cs to extend InstallScriptTestBase
  • Create GivenThatIWantToInstallDotnetRuntimeFromAScript.cs for runtime tests (parallel collection)
  • Add xunit.runner.json to explicitly configure parallel test collection execution
  • Update azure-pipelines-PR.yml to use Helix for all platforms
  • Resolve merge conflicts with main branch
  • Fix azure-pipelines-PR.yml: update net8.0net10.0, 8.0.12610.0.106 to match the project's target framework

Copilot AI and others added 2 commits April 28, 2026 22:47
… split

- Switch powershell.exe to pwsh in DotNetCommand.cs (faster startup)
- Create InstallScriptTestBase.cs abstract base class with shared data/helpers
- Refactor GivenThatIWantToInstallDotnetFromAScript to extend base (SDK tests only)
- Add GivenThatIWantToInstallDotnetRuntimeFromAScript as separate xunit collection
- Add xunit.runner.json with explicit parallel collection settings
- Split Windows pipeline job into Validation (30min) and Installation (60min) parallel jobs

Agent-Logs-Url: https://github.com/dotnet/install-scripts/sessions/1e4f64e5-b501-42eb-bfc5-0862d29419e1

Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
… to .gitignore

Agent-Logs-Url: https://github.com/dotnet/install-scripts/sessions/1e4f64e5-b501-42eb-bfc5-0862d29419e1

Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve PR validation speed for Windows builds Reduce Windows PR validation time: pwsh, parallel test collections, split pipeline jobs Apr 28, 2026
Copilot AI requested a review from ellahathaway April 28, 2026 22:50
@MichaelSimons
Copy link
Copy Markdown
Member

In-process test parallelism via class split

To me, this is an indicator that Helix should be utilized instead. The is less overhead w/Helix.

ellahathaway and others added 2 commits April 29, 2026 10:31
Replace separate Windows, Linux, and macOS pipeline jobs with a single
job that sends tests to Helix across all three platforms. Tests run on
Windows.10.Amd64.Open, Ubuntu.2204.Amd64.Open, and OSX.15.ARM64.Open
queues.

- Add HELIX_CORRELATION_PAYLOAD support to GetRepoRoot() for script path
  resolution on Helix machines
- Move chmod +x logic into DotNetCommand.ExecuteInstallation() so tests
  handle permissions themselves on non-Windows
- Add Verify snapshot fallback to AppContext.BaseDirectory for Helix
- Include Assets/*.verified.txt as Content items in test project
@github-project-automation github-project-automation Bot moved this from Backlog to Done in .NET Install Scripts Apr 29, 2026
@ellahathaway ellahathaway reopened this Apr 29, 2026
@github-project-automation github-project-automation Bot moved this from Done to In Progress in .NET Install Scripts Apr 29, 2026
Use sequence key-value syntax for job variables to match what
eng/common/templates/job/job.yml expects at line 113.
- Use 'powershell' instead of 'pwsh' (not available on Helix Windows)
- Add XUnitWorkItemTimeout of 30 minutes for integration tests
- Suppress NETSDK1023 (Helix SDK implicit test refs) and xUnit1026
  (pre-existing unused parameter warnings)
@ellahathaway
Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits May 11, 2026 14:28
Resolve conflicts:
- .gitignore: keep .nuget/ (directory) as it's more comprehensive
- azure-pipelines-PR.yml: keep Helix-based approach
- GivenThatIWantToInstallDotnetFromAScript.cs: keep refactored version
  (extending InstallScriptTestBase, runtime tests in separate class)

Also incorporate from main:
- Assert.SkipWhen/SkipUnless instead of early-return patterns (xunit v3)
- HashSet deduplication in InstallRuntimeFromChannelTestCases
- #pragma warning disable xUnit1026 for unused versionRegex params

Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
…eduplication

- Remove `using Xunit.Abstractions` from new test files (xunit v3 exposes
  ITestOutputHelper directly via `using Xunit`)
- Use Assert.SkipWhen/SkipUnless instead of early-return guards in
  GivenThatIWantToInstallDotnetRuntimeFromAScript.cs
- Add HashSet deduplication in InstallScriptTestBase.InstallRuntimeFromChannelTestCases
- Add #pragma warning disable xUnit1026 for unused versionRegex params

Agent-Logs-Url: https://github.com/dotnet/install-scripts/sessions/d783e1ab-5163-4ed0-9047-991462c67eb9

Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 11, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in commit bd7fa02. The merge incorporated the following from main:

  • Assert.SkipWhen/SkipUnless patterns (xunit v3 style) in all test files
  • HashSet deduplication in InstallRuntimeFromChannelTestCases
  • Updated using directives (Xunit.Abstractions dropped; ITestOutputHelper is in Xunit namespace in xunit v3)

Conflicts resolved:

  • .gitignore: kept .nuget/ (directory pattern, more comprehensive)
  • azure-pipelines-PR.yml: kept Helix approach (per @MichaelSimons's suggestion)
  • GivenThatIWantToInstallDotnetFromAScript.cs: kept refactored structure (extending InstallScriptTestBase, runtime tests in separate class)

In-process test parallelism via class split

To me, this is an indicator that Helix should be utilized instead. The is less overhead w/Helix.

Agreed. The PR was updated in commit c60fded to use Helix (/eng/common/templates/steps/send-to-helix.yml) for all three platforms (Windows, Ubuntu, macOS) in a single pipeline job, rather than keeping the separate per-platform jobs with direct dotnet test invocations.

Copilot AI changed the title Reduce Windows PR validation time: pwsh, parallel test collections, split pipeline jobs Reduce Windows PR validation time: Helix, parallel test collections, pwsh May 11, 2026
Copy link
Copy Markdown
Member

@ellahathaway ellahathaway left a comment

Choose a reason for hiding this comment

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

@copilot - PR validation is failing with the following error:

D:\a\_work\1\s\.dotnet\sdk\10.0.106\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file 'D:\a\_work\1\s\artifacts\obj\Install-Scripts.Test\project.assets.json' doesn't have a target for 'net8.0'. Ensure that restore has run and that you have included 'net8.0' in the TargetFrameworks for your project. [D:\a\_work\1\s\tests\Install-Scripts.Test\Install-Scripts.Test.csproj]

We've moved to .NET 10, so please address the failure accordingly.

The project targets net10.0 (per global.json and Install-Scripts.Test.csproj)
but azure-pipelines-PR.yml still referenced net8.0 for XUnitPublishTargetFramework
and DotNetCliVersion, causing the assets file error during Helix publish.

Agent-Logs-Url: https://github.com/dotnet/install-scripts/sessions/fab58547-fdf3-4709-9daf-73aae61eabab

Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 11, 2026

@copilot - PR validation is failing with the following error:

Fixed in e06dc2e. The Helix configuration in azure-pipelines-PR.yml had leftover .NET 8 references from when it was initially written. Updated:

  • version: 8.x10.x (UseDotNet task)
  • XUnitPublishTargetFramework: net8.0net10.0
  • XUnitRuntimeTargetFramework: netcoreapp2.0net10.0
  • DotNetCliVersion: 8.0.12610.0.106 (matching global.json)

Copilot AI requested a review from ellahathaway May 11, 2026 15:54
ellahathaway and others added 8 commits May 11, 2026 09:03
Use build.ubuntu.2204.amd64.open instead of Ubuntu.2204.Amd64.open
to match the actual image name in the NetCore-Public pool.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The send-to-helix template creates SendToHelix.binlog inside the source
directory while simultaneously trying to zip that directory as the Helix
payload, causing an IOException on Windows. Fix by staging repo files
(excluding .git, artifacts, .dotnet) to a temp directory and pointing
WorkItemDirectory there.

Also fixes the Unix WorkItemCommand (already corrected to ./build.sh --test).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PowerShell doesn't search the current directory by default, so use
explicit relative path like the Unix job does with ./build.sh.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Zip archives don't preserve Unix execute permissions. When the Helix SDK
extracts the payload on Linux/macOS, all .sh files lose their execute bit.
Add a pre-command to restore permissions before the work item runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ellahathaway ellahathaway force-pushed the copilot/optimize-windows-pr-validation branch from 0f1ded6 to 0d4573e Compare May 11, 2026 19:28
ellahathaway and others added 2 commits May 11, 2026 15:38
The main branch runs tests on macOS-latest (x64). Using OSX.15.ARM64.Open
caused failures because old .NET SDK channels (2.1.x, 2.2.x, etc.) never
shipped ARM64 macOS builds. Switch to OSX.14.Amd64.Open for parity.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Instead of sending all tests as a single work item (which timed out on
Windows after 30 minutes), split into one work item per test class:
- Windows: 5 work items (AkaMsLinks, SdkLinks, InstallDotnet, InstallRuntime, WindowsTar)
- Unix: 5 work items (AkaMsLinks, BashTar, SdkLinks, InstallDotnet, InstallRuntime)

Each work item runs Build.cmd/build.sh --test with a class filter via
TestRunnerAdditionalArguments env var, avoiding cmd.exe %20 escaping issues.

Also upgrades Windows queue from Windows.10 (Server 2016) to Windows.11.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

PR validation Windows leg takes ~50 minutes

3 participants