Skip to content

Conversation

@rmarinho
Copy link
Member

This pull request introduces a comprehensive code coverage implementation for the XHarness project, enabling easy generation, viewing, and integration of coverage reports. The changes automate coverage setup for all test projects, provide cross-platform scripts and documentation, and support CI/CD integration. The most important changes are grouped below:

Core Implementation

  • Added coverlet.collector and coverlet.msbuild version 6.0.0 to Directory.Packages.props, ensuring coverage tools are available for all test projects.
  • Created tests/Directory.Build.props to automatically reference Coverlet packages in all test projects, eliminating manual setup.
  • Added tests/coverlet.runsettings with optimized configuration for exclusions, output formats (Cobertura, OpenCover, JSON), and SourceLink support.

Cross-Platform Coverage Scripts

  • Added run-coverage.sh (Linux/macOS) and run-coverage.ps1 (Windows) scripts to automate running tests with coverage and generating results in artifacts/coverage/. [1] [2]

Documentation & Quickstart

  • Added docs/code-coverage.md and COVERAGE_IMPLEMENTATION.md for comprehensive instructions, configuration details, CI/CD integration, and troubleshooting. Also added COVERAGE_QUICKSTART.md for a simple usage guide. [1] [2] [3]
  • Updated README.md to include a code coverage section and reference the new documentation.

CI/CD Integration

  • Provided example Azure Pipelines YAML (docs/azure-pipelines-coverage-example.yml) for integrating coverage collection and publishing in CI workflows.

Project Hygiene

  • Updated .gitignore to exclude coverage outputs and test result files, keeping the repository clean.

These changes collectively make it easy to collect, view, and integrate code coverage in XHarness across local and CI environments.

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.

1 participant