Skip to content

[flaky-ci] Pin test slicer to repo-local runtime - #12706

Merged
jonathanpeppers merged 1 commit into
mainfrom
simonrozsival-fix-test-slicer-runtime
Sep 8, 2026
Merged

jonathanpeppers merged 1 commit into
mainfrom
simonrozsival-fix-test-slicer-runtime

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Why

Hosted macOS builds 1574631 and 1574989 installed dotnet-test-slicer successfully, then failed before running tests because its native apphost could not locate .NET. The tool was invoked by absolute path, so adding its directory to PATH did not help runtime discovery; both DOTNET_ROOT_X64 and DOTNET_ROOT were unset.

The pinned slicer package targets net8.0 with rollForward: LatestMajor, while test setup already installs the repository-pinned compatible SDK under bin/$(XA.Build.Configuration)/dotnet.

Tracked by #12704.

What changed

  • Set DOTNET_ROOT to the repo-local SDK for every initial and retry slicer invocation.
  • Forward xaSourcePath through the emulator-stage template so custom checkout paths resolve the same SDK installed during setup.

Validation

  • Parsed both changed YAML templates and checked parameter substitution for a custom source root.
  • Confirmed all three slicer invocations receive the expanded repo-local DOTNET_ROOT.
  • Launched dotnet-test-slicer 0.1.0-alpha7 successfully against a .NET 11-only runtime root, exercising its configured major-version roll-forward.

Set DOTNET_ROOT for every test slicer invocation so its apphost uses the SDK provisioned by the test setup instead of relying on hosted-agent runtime registration.

Co-authored-by: Copilot App <[email protected]>
@simonrozsival simonrozsival added the flaky-ci Intermittent CI failures and work to improve CI reliability label Sep 8, 2026
@simonrozsival
simonrozsival marked this pull request as ready for review September 8, 2026 14:23
Copilot AI lite review requested due to automatic review settings September 8, 2026 14:23
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #12706

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The change is narrowly scoped to CI template behavior and appears to address the reported runtime-discovery failure without introducing functional risk.

Review tier: Lite
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity build-tools/​automation/​yaml-templates/​run-sliced-nunit-tests.yaml — 💡 Suggestion: DOTNET_ROOT is computed as `${{ parameters.xaSourcePath…
What changed in this PR

This PR adjusts Azure Pipelines test templates to ensure dotnet-test-slicer reliably finds the repo-pinned .NET runtime during CI, addressing macOS flakiness where the slicer’s native apphost can’t resolve .NET when invoked by absolute path.

Changes:

  • Sets DOTNET_ROOT to the repo-local SDK (bin/$(XA.Build.Configuration)/dotnet) for each dotnet-test-slicer invocation (slice + retry).
  • Forwards xaSourcePath through the MSBuild emulator stage template into the sliced NUnit test template.
File Description
build-tools/​automation/​yaml-templates/​stage-msbuild-emulator-tests.yaml Passes xaSourcePath into the sliced NUnit template so custom checkout roots stay consistent.
build-tools/​automation/​yaml-templates/​run-sliced-nunit-tests.yaml Pins slicer runtime discovery by exporting DOTNET_ROOT for slicer steps.

Comment thread build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: ⏳ CI pending

No blocking code findings (0 errors, 0 warnings). The change applies the repo-local runtime root to both slicer branches and the retry invocation, and correctly forwards the custom source root through the emulator-stage template. The completed emulator matrix is green, but the newest required CI run is still in progress, so this is not yet a green-build verdict.

One non-blocking DRY suggestion is already posted inline; I did not duplicate it.

Generated by Android PR Reviewer for #12706 · gpt56 · 87.6 AIC · ⌖ 3.52 AIC · ⊞ 27.7K
Comment /review to run again

@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Sep 8, 2026
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #12706

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ LGTM — 0 errors, 0 warnings, 0 suggestions.

The repo-local DOTNET_ROOT is applied to all three dotnet-test-slicer apphost invocations, and xaSourcePath is now forwarded by the emulator-stage template so custom checkout roots remain aligned with test setup. All 45 reported checks are successful.

Generated by Android PR Reviewer for #12706 · gpt56 · 82.9 AIC · ⌖ 8.75 AIC · ⊞ 25.7K
Comment /review to run again

@jonathanpeppers
jonathanpeppers merged commit ea3b51b into main Sep 8, 2026
45 checks passed
@jonathanpeppers
jonathanpeppers deleted the simonrozsival-fix-test-slicer-runtime branch September 8, 2026 22:01
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

flaky-ci Intermittent CI failures and work to improve CI reliability ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants