Skip to content

test(analyzers): raise compiler tooling coverage - #10894

Merged
ReubenBond merged 4 commits into
dotnet:mainfrom
ReubenBond:rb-issue-10857-raise-compiler-coverage
Aug 28, 2026
Merged

ReubenBond merged 4 commits into
dotnet:mainfrom
ReubenBond:rb-issue-10857-raise-compiler-coverage

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Problem

Compiler-tooling coverage misses substantial analyzer/code-fix behavior and leaves TypeSymbolResolver's highest-complexity paths largely unverified. The analyzer project also lacks first-class CI traits, so its existing contract-version suite does not participate in the canonical coverage selection.

Solution

  • Tag analyzer tests with the canonical BVT, provider, and area traits.
  • Add behavior-focused coverage for contract code-fix guards, CRLF preservation, and non-constant ConfigureAwaitOptions expressions.
  • Add direct resolver tests for aliases, nested/generic syntax, fallback indexing, metadata identity, ambiguity, cancellation, and proxy invariants.
  • Make simple-name assembly ambiguity terminal and clear failed proxy results.
  • Replace duplicated primitive-type switches with shared lookups and remove an unused resolver overload.

Rationale

The three named hotspot files move from 14.8% line / 3.9% branch coverage to 86.3% line / 77.7% branch coverage, with CRAP>30 methods reduced from 23 to 6. TypeSymbolResolver.cs reaches 90.9% line / 85.7% branch coverage, while its primitive helper complexity drops from 80/72 to 10/1.

Part of #10857.

Microsoft Reviewers: Open in CodeFlow

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

Review tier: Lite
Findings: None

What changed in this PR

This PR increases test coverage for Orleans compiler tooling (analyzers/code fixes and code generator type resolution) while also tightening TypeSymbolResolver behavior around assembly-name ambiguity and proxy-interface validation.

Changes:

  • Adds a comprehensive new test suite for TypeSymbolResolver, covering metadata identity resolution, fallback behavior, ambiguity handling, and cancellation.
  • Expands analyzer/code-fix tests to cover code-fix registration guards, CRLF preservation, and additional ConfigureAwaitOptions expression scenarios.
  • Refactors TypeSymbolResolver primitive-type handling via shared lookup tables and removes an unused overload; makes simple-name assembly ambiguity terminal and clears failed proxy results.
File Description
test/​Orleans.CodeGenerator.Tests/​TypeSymbolResolverTests.cs New direct unit tests covering TypeSymbolResolver high-complexity and edge-case paths.
test/​Orleans.Analyzers.Tests/​GrainInterfaceVersionAnalyzerTest.cs Adds tests for code-fix guard behavior and CRLF-preserving contract file updates.
test/​Orleans.Analyzers.Tests/​ConfigureAwaitAnalyzerTest.cs Adds diagnostic/no-diagnostic coverage for non-constant and partially-known ConfigureAwaitOptions expressions.
test/​Orleans.Analyzers.Tests/​AssemblyInfo.cs Adds canonical test suite/provider/area traits so analyzer tests participate in the intended CI lanes.
src/​Orleans.CodeGenerator/​TypeSymbolResolver.cs Refines assembly/type resolution semantics, proxy resolution output behavior, and consolidates primitive-type mappings.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Code coverage

79.41% line coverage - 100,568 / 126,644 lines

Coverage details

@ReubenBond
ReubenBond merged commit a07fad4 into dotnet:main Aug 28, 2026
76 checks passed
@ReubenBond
ReubenBond deleted the rb-issue-10857-raise-compiler-coverage branch August 28, 2026 06:52
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants