Skip to content

Conversation

@willibrandon
Copy link
Owner

Overview

Adds test coverage analysis capabilities to NetContextServer, letting AI assistants understand and query code coverage data. Supports Coverlet JSON, LCOV, and Cobertura XML formats while integrating with existing MCP tools.

Key Features

  • Parse coverage reports to find uncovered lines and branches
  • Support multiple coverage formats with pluggable parsers
  • File-level and project-wide coverage stats
  • Works within existing base directory and security constraints
  • Structured JSON output for AI consumption

New Components

  • CoverageAnalysisService for parsing coverage data
  • coverage_analysis and coverage_summary MCP tools
  • Coverage models and test suite
  • CLI commands for coverage analysis and reporting

Example Usage

dotnet run -- coverage-analysis --report-path "coverage.json" --format coverlet

Testing

  • Tests for different coverage format parsing
  • Integration tests for MCP tools
  • Security tests for base directory rules
  • Performance tests with large coverage files

Documentation

  • XML docs for public APIs
  • Usage examples in code comments
  • README updates for new commands

Implements coverage report analysis for .NET projects with support for:
- Multiple coverage formats (Coverlet JSON, LCOV, Cobertura XML)
- File-level coverage statistics and uncovered line detection
- Branch coverage tracking and coverage percentage calculation
- Integration with existing MCP tools architecture

New components:
- CoverageAnalysisService for parsing coverage reports
- coverage_analysis and coverage_summary MCP tools
- Coverage-specific models and test suite
- Added a method to identify generated code files based on common patterns.
- Updated coverage analysis logic to skip generated code files during report parsing.
- Introduced a new test to verify that generated code is excluded from coverage reports, ensuring accurate coverage statistics for regular code.
…y statistics

- Added file type indicators (Production, Test, Generated) to coverage report outputs using emojis for better visual distinction.
- Updated coverage summary to include statistics for production and test files, enhancing the overall reporting capabilities.
- Introduced new properties in CoverageReport and CoverageSummary models to support file type categorization and coverage metrics.
@willibrandon willibrandon merged commit 70c51c2 into main Mar 28, 2025
3 checks passed
@willibrandon willibrandon deleted the feature/test-coverage-analysis-tool branch March 28, 2025 22:07
@willibrandon willibrandon restored the feature/test-coverage-analysis-tool branch March 28, 2025 22:09
willibrandon added a commit that referenced this pull request Mar 28, 2025
@willibrandon willibrandon deleted the feature/test-coverage-analysis-tool branch March 28, 2025 22:12
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.

2 participants