Narrow Dynamic Exclude Filters for Loaded Assemblies
Merged
BE
1mo ago+73+73+01234567890123456789-11-11-01234567890123456789
This pull request refines the logic for generating dynamic exclude filters in Coverlet.MTP, making the exclusion of assemblies more precise and reducing the risk of unintentionally excluding assemblies that share common prefixes with the system under test (SUT). The update distinguishes between exclusions derived from deps.json (which remain wildcarded) and those from loaded assemblies (which are now exact matches), and updates documentation and tests accordingly.
Dynamic Exclude Filter Precision Improvements:
- Updated dynamic exclude filter generation so that assemblies discovered via
deps.jsoncontinue to use wildcard filters, while assemblies already loaded in the controller process now use exact-name filters for exclusion. This prevents overly broad exclusions that could unintentionally exclude SUT assemblies with similar prefixes.
Documentation Updates:
- Revised the documentation in
Coverlet.MTP.Integration.mdto clarify the new behavior of dynamic exclude filters, explaining the distinction between runtime discovery sources and the improved exclusion precision for loaded assemblies.
Test Enhancements:
- Added and updated tests in
CoverageConfigurationDynamicExcludeTests.csto verify that loaded assemblies are excluded using exact-name filters and that wildcard filters are not erroneously applied to SUTs with shared prefixes. - Added tests in
ProcessAssemblyHelperTests.csto ensure the newToExactExcludeFiltermethod generates the correct filter patterns.