Skip to content

Skip API baseline edits that are not affected-test inputs - #12614

Merged
Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/compare-cts-affected-tests
Nov 24, 2026
Merged

Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/compare-cts-affected-tests

Conversation

@Evangelink

@Evangelink Amaury Levé (Evangelink) commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 9a50ccc4469b807ffb65ffcbf03c89125f5261f3

Dimension Assessment Rationale
Change confidence 9/10 ↑ The real SDK ignored all 154 intended paths and honored each of the six exceptions.
↑ An unrelated text change still ran the module.
↓ No hosted skip-rate measurement yet.
Diagnosis confidence 9/10 ↑ Before the policy change, the selector named the first API baseline as unmapped and ran the module.
Evidence fit 9/10 ↑ The observed fallback reproduces the baseline-only case.
↓ Other changed files or an unusable map can independently require full execution.

Pull request

Summary

Editing an API tracking file can trigger a full test run because the file has no source-to-test association. Ignore PublicAPI.Shipped.txt, PublicAPI.Unshipped.txt, InternalAPI.Shipped.txt, and InternalAPI.Unshipped.txt during affected-test selection, except for six files read by an acceptance test. Build-time API checks are unchanged.

Design and decision record

AssertSourceCompatibilityTests reads the shipped and unshipped public baselines in src/MSTest/TestFramework/PublicAPI and its net and net10.0 subdirectories. Six exact forceAllTests rules take precedence over the filename ignores, so edits to those inputs still run the guard. The CI selection policy documents the exception.

Demonstration

The same edit to the 154 non-exception baselines produced these selector messages (module prefix omitted):

Before: Falling back to all tests (planned count unavailable): changed path 'src/MSTest/MSTest.Extensions.Hosting/InternalAPI/InternalAPI.Shipped.txt' has no source-to-test association.
After:  Selected 0 tests; no tests will be run: no mapped source changes affect this test module.

Validation and regression proof

pwsh -NoLogo -NoProfile -File .\eng\validate-affected-tests.ps1 -SelfTest -EnableAffectedTests true -EnableNonWindowsAffectedTests false passed (exit 0) at the PR head.

For the selection checks, the same Release FSharpPlayground host (net10.0, one test) ran under SDK 12.0.100-alpha.1.26570.125 in isolated Git fixtures. Each fixture used its revision's change rules and fresh local map storage. With $root set to the fixture directory and the pinned SDK on PATH, the commands were:

dotnet test --test-modules bin\FSharpPlayground.dll --root-directory $root --no-build --no-ansi --progress off --collect-test-map
dotnet test --test-modules bin\FSharpPlayground.dll --root-directory $root --no-build --no-ansi --progress off --affected-tests

Collection succeeded for both policies. Every apply command exited 0; the number of executed tests distinguished full fallback from an intentionally empty selection. No hosted CI savings are claimed.

Test-value evidence

Fixture change Observed result
All 154 non-exception baselines, parent be3cf477a83f9b94e416b0401163a48580e389aa Full fallback; FSharpPlayground.TestClass.Test1 ran and passed.
Same paths, policy in 9a50ccc4469b807ffb65ffcbf03c89125f5261f3 All 154 paths logged as ignored; 0 tests selected and 0 executed.
Each protected baseline changed individually All six runs named the matching force rule; one test ran and passed each time.
Ignored baselines plus Other.Shipped.txt The unrelated file remained unmapped; one test ran and passed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 19:51
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Nov 24, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 24, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. labels Nov 24, 2026

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

Note

🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.

No blocking findings.

  • The six forceAllTests paths match exactly the files read by AssertSourceCompatibilityTests (PublicAPI/{,net/,net10.0/}PublicAPI.{Shipped,Unshipped}.txt), and all six exist.
  • Per the PR description, forceAllTests takes precedence over ignore, so the **/PublicAPI.*.txt ignore doesn't hide these inputs. I didn't verify that precedence against the selection tool's source.
  • Scope note: the other PublicAPI folders (net462, desktop, deployment) aren't read by that test, so ignoring them is consistent.
  • Scope note: the unchanged MSTest.Analyzers and other projects also contain PublicAPI text files. They are ignored by the new globs, which is the intended behavior (text-only baselines).
  • Docs bullet in docs/affected-test-selection.md is consistent with the config.

Test-value evidence: configuration/docs-only change. I ran no selection comparison, so the precedence behavior is unexecuted evidence.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 24, 2026

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

🧪 Test quality review — PR #12614

Compared merge base be3cf477a83f9b94e416b0401163a48580e389aa with head 9a50ccc4469b807ffb65ffcbf03c89125f5261f3. Evidence applies to this head only.

Test-value evidence

Contract Evidence Status
global.json affected-test policy: ignore PublicAPI/InternalAPI text baselines, but forceAllTests for the six baselines read by AssertSourceCompatibilityTests AssertSourceCompatibilityTests.cs lines 1491-1500 read exactly those six paths, and all six exist in the repo. Static prediction: without the forceAllTests entries, ignore would skip that test when the files change. Static prediction. No paired execution records, and none are expected for a CI selection policy.
docs/affected-test-selection.md Documentation only. Not applicable

No test files changed.

🧵 Parallel safety

NOT_APPLICABLE. No changed tests or parallelization configuration were in scope.

Per-test assessment

No test methods changed, so nothing was graded. Scope: Not applicable.

This advisory review is heuristic and non-blocking. Re-run the combined review with /review-tests, or only the parallel-safety specialist with /parallel-audit.

🤖 Automated content by GitHub Copilot. Generated by the Test Quality Review on PR (on open / sync) workflow. · copilot · auto (Claude Sonnet 5.5) · ~21 AIC · ⌖ ~2 AIC · ⊞ 8.5K

@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 24, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 24, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 24, 2026

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.

🟢 Approval recommended

No active review issues remain for the affected-test selection changes that exclude API baselines not used as test inputs.

No open issues 🎉

What changed in this PR

This PR narrows TestFx’s affected-test selection so API baseline edits that are not test inputs avoid unnecessary full test runs. Build-time API validation remains unchanged.

Changes:

  • Ignore shipped and unshipped public and internal API baseline filenames during affected-test selection.
  • Preserve full test execution for the six public baselines read by AssertSourceCompatibilityTests.
  • Document the exceptions and the precedence of forceAllTests over ignore.

Confidence at a glance

🟡 Selection policy and documentation — execution evidence not independently verified

Test-value evidence: For revision 9a50ccc4469b807ffb65ffcbf03c89125f5261f3, the PR reports that all 154 non-exception baselines were ignored, each protected baseline triggered full execution, and an unrelated text change retained fallback behavior. The reported parent comparison ran one test instead of selecting none. These results were not independently reproduced during this review; hosted CI savings remain unmeasured.

File Description
global.json Adds four baseline ignore patterns and six exact-path full-test exceptions.
docs/​affected-test-selection.md Explains baseline exclusions, acceptance-test exceptions, and unchanged build-time checks.

Review effort: Balanced

@Evangelink
Amaury Levé (Evangelink) merged commit a684c0a into main Nov 24, 2026
40 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/compare-cts-affected-tests branch November 24, 2026 21:52
@github-actions github-actions Bot removed the state/approved Proposal approved; ready for implementation. label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants