[testing] Adding test coverage with copilot #1479
Draft
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.
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
coverlet.collectorandcoverlet.msbuildversion 6.0.0 toDirectory.Packages.props, ensuring coverage tools are available for all test projects.tests/Directory.Build.propsto automatically reference Coverlet packages in all test projects, eliminating manual setup.tests/coverlet.runsettingswith optimized configuration for exclusions, output formats (Cobertura, OpenCover, JSON), and SourceLink support.Cross-Platform Coverage Scripts
run-coverage.sh(Linux/macOS) andrun-coverage.ps1(Windows) scripts to automate running tests with coverage and generating results inartifacts/coverage/. [1] [2]Documentation & Quickstart
docs/code-coverage.mdandCOVERAGE_IMPLEMENTATION.mdfor comprehensive instructions, configuration details, CI/CD integration, and troubleshooting. Also addedCOVERAGE_QUICKSTART.mdfor a simple usage guide. [1] [2] [3]README.mdto include a code coverage section and reference the new documentation.CI/CD Integration
docs/azure-pipelines-coverage-example.yml) for integrating coverage collection and publishing in CI workflows.Project Hygiene
.gitignoreto 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.