Repository navigation
Run only affected test apps in pull request builds - #14630
Open
Don Syme (dsyme) wants to merge 6 commits into
Open
Don Syme (dsyme) wants to merge 6 commits into
Don Syme (dsyme) wants to merge 6 commits into
Conversation
Re-wires the BuildOptimization test selection (microsoft#7392) that was dropped when test projects moved to Invoke-PerProjectTestRun, and computes PR changes from the PR merge commit so base-branch changes missing from a stale PR branch are no longer treated as PR changes. Non-PR events still run every test app. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Issue #14628 is not valid. Please make sure you link an issue that exists, is open and is approved. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Nov 26, 2026
Reuse upstream churn analysis and tested-merge diff logic. Apply test selection only in PR builds while retaining logging-only behavior elsewhere, full-run fallbacks and mandatory NewObjects tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Include the newly landed Verifactu changes without further changes to the tested PowerShell resolution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Persist a successful completion marker for known-empty PR test selection so subsequent per-app hooks reuse the result rather than repeating discovery and impact analysis. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore comment help on Get-CachedTestRunResult and document the per-container state path and empty-selection marker helpers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14628. Part of #14597.
What changed
ApplySelectionswitch toGet-SelectedTestApps.Invoke-PerProjectTestRunenables it only forpull_requestevents; other events retain upstream logging-only behavior and run the original full bucket.Get-ChangedFilesForCI -CompareWithPullRequestMerge, including verified tested-merge comparison, shallow-checkout support and both paths for renamed files.Tests-NewObjects-Internalselection. A known empty proposal skips dispatch, writes a successful per-container completion marker, and lets subsequent app hooks reuse that result instead of repeating discovery and impact analysis.enableChurnBasedTestingto false or leaving it absent bypasses selection and runs the full bucket, including on PRs.Safety and scope
Unknown impact and AL-Go full-build patterns retain all tests. Merge queue, push, schedule and workflow-dispatch test selection remain unchanged. The selector only changes test workloads on the
GitHub-BCAppsPLself-hosted pool; it does not directly reduce GitHub-hosted job-minutes. This PR changesbuild/scripts, so its own run matches the full-build fallback and does not demonstrate the savings. No coverage change from #14583 is included.Savings estimate (self-hosted; sensitivity only)
In the frozen baseline week, 279 PR runs whose current PR file lists touched
src/Appswithout matching a full-build pattern used about 850,258 self-hosted Unit Tests job-min/day. A 10%-25% reduction in aggregate test-job duration for this eligible cohort would correspond to about 85,000-213,000 self-hosted job-min/day. This is a sensitivity scenario, not a forecast or measured saving: test selection counts do not map directly to job duration, the historical classification uses current PR file lists rather than each run’s exact diff, and the existing probes also changed the country matrix under #14631, so they cannot isolate this PR’s effect. No direct hosted saving is claimed.Validation