Repository navigation
test(analyzers): add package branch coverage tests and benchmark - #174
Merged
Merged
Conversation
Cover the branches left open on the E128.Analyzers and E128.Analyzers.CodeFixers surface. The new test classes raise package branch coverage from about 87 to about 91 percent. Add PackageAnalyzerBenchmarks. It finds every analyzer in the assembly by reflection and runs the set over one sample service, so a new rule joins the run without an edit. Update lode/dotnet/analyzers/testing.md and lode/dotnet/benchmarks.md to match the new coverage figure and the new benchmark class. Co-Authored-By: Claude
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.
Executive Summary
The
E128.Analyzerspackage left a large share of its branches without a test. The new test classes drive those branches through the analyzer and code-fix harnesses. Measured with the repository coverage collection, the package branch surface moves from about 87 to about 91 percent.The same change adds
PackageAnalyzerBenchmarks. It finds every analyzer in the assembly by reflection and runs the set over one sample service, so a rule added later joins the run without an edit to the benchmark.Code Changes
tests/E128.Analyzers.Tests: 136 new test classes cover the remaining branches on the analyzer and code-fixer surface. Each class targets one analyzer or code-fix provider and asserts the observable diagnostic or fix behavior.benchmarks/E128.Benchmarks/PackageAnalyzerBenchmarks.cs: measures the consumer build path over the whole analyzer set.GlobalSetupthrows when the assembly yields no analyzer, and the run throws when the set reports no diagnostic. The code fixers are not measured.lode/dotnet/benchmarks.mdrecords the benchmark class, the in-process toolchain, and the E128227 suppression the benchmark relies on.lode/dotnet/analyzers/testing.mdrecords the new coverage figure.Tests and Tooling
scripts/check.sh --all: shell lint, format check, build, and test all pass.scripts/test.sh --all --verbose: 5781 passed, 2 skipped. Both skips predate this change.scripts/internal/analyzer-release-check.sh --json: clean. No rule row is missing, duplicated, or orphaned.scripts/readme-table-diff.sh --analyzer --json: no drift.Review Guide
PackageAnalyzerBenchmarksreflection lookup and itsGlobalSetupguards: confirm the throw conditions match the intent ofAnalyzerBenchmarks.<Subject>BranchCoverage<Kind>Testsconvention.lode/dotnet/analyzers/testing.mdis a rounded snapshot and carries the date it was measured.Rollback
Revert this commit. The change adds tests, one benchmark class, and documentation. It does not touch analyzer source, so no shipped rule changes behavior.
🤖 Generated with Claude Code