Skip to content

Add NetAnalyzers conditional test scope#55397

Merged
MichaelSimons merged 1 commit into
mainfrom
michaelsimons-netanalyzers-conditional-test-scope
Jul 21, 2026
Merged

Add NetAnalyzers conditional test scope#55397
MichaelSimons merged 1 commit into
mainfrom
michaelsimons-netanalyzers-conditional-test-scope

Conversation

@MichaelSimons

@MichaelSimons MichaelSimons commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

Adds a NetAnalyzers scope to the PR conditional test filtering framework so that NetAnalyzers tests are skipped on PRs that don't touch the analyzer source. Also makes eng/Version.Details.xml a global trigger path so any dependency update forces the full suite to run.

Changes

  • test/ConditionalTests.props

    • New NetAnalyzers ConditionalTestScope (Mechanism=project) covering src/Microsoft.CodeAnalysis.NetAnalyzers/tests/**/*.csproj, triggered by changes under src/Microsoft.CodeAnalysis.NetAnalyzers/**, with RunAlways=CI.
    • Added eng/Version.Details.xml to GlobalTriggerPaths so any dependency update (VMR or external flows like microsoft/testfx) forces all scopes to run.
    • Documented in the header comments that trigger paths (global and per-scope) should be listed alphabetically for readability.
  • documentation/project-docs/pr-test-filtering.md

    • Clarified that RunAlways supports only CI today.
    • New "Handling flowed-in dependencies" section explaining why eng/Version.Details.xml is a global trigger.
    • "Future enhancements" note on a possible finer-grained per-repo RunAlways=Dependency:<owner>/<repo> condition and why it wasn't adopted.

Related to #55203

Skips NetAnalyzers tests on PRs that don't touch relevant source. Trigger paths
cover the analyzer source (src/Microsoft.CodeAnalysis.NetAnalyzers/**).

Adds eng/Version.Details.xml as a global trigger path so that any dependency
update (VMR or testfx) forces all scopes to run. Dependency flows are broad,
wide-reaching changes worth validating fully, and making this global is
safe-by-default for future scopes. Documents this decision and records why a
finer-grained per-repo RunAlways=Dependency mechanism is intentionally not
supported yet (no ROI given only two dependency flows today).

Trigger paths are listed in alphabetical order for readability, and that
convention is noted in the props file.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f5bbf7c3-1a14-4d0d-bef5-a0641df6dc67
Copilot AI review requested due to automatic review settings July 21, 2026 16:50
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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.

Pull request overview

Adds a new conditional test scope for the NetAnalyzers test projects so they can be skipped on PRs that don’t touch analyzer sources, and expands the “global triggers” so dependency updates force the full conditional-test set to run.

Changes:

  • Added a NetAnalyzers ConditionalTestScope (project-level) keyed off src/Microsoft.CodeAnalysis.NetAnalyzers/**.
  • Added eng/Version.Details.xml to GlobalTriggerPaths to disable conditional filtering on dependency-update PRs.
  • Updated the PR test filtering documentation to clarify RunAlways behavior and document dependency-flow handling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/ConditionalTests.props Adds NetAnalyzers scope and a global trigger for eng/Version.Details.xml; updates header guidance on ordering.
documentation/project-docs/pr-test-filtering.md Documents RunAlways limitations and explains the dependency-flow rationale for the new global trigger.

Comment thread test/ConditionalTests.props
@MichaelSimons

Copy link
Copy Markdown
Member Author

Build analysis appears hung - all legs passed - merging.

@MichaelSimons
MichaelSimons merged commit 9371ee3 into main Jul 21, 2026
33 of 34 checks passed
@MichaelSimons
MichaelSimons deleted the michaelsimons-netanalyzers-conditional-test-scope branch July 21, 2026 22:03
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.

4 participants