So I was able to supply runsettings and that worked
dotnet test --filter "TestCategory != Ignore" --no-build --no-restore -v normal --collect "Code coverage" -s *.runsettingss
Which included this:
<ModulePaths>
<Include>
<ModulePath>.*\.dll$</ModulePath>
<ModulePath>.*\.exe$</ModulePath>
</Include>
<Exclude>
<ModulePath>.*\\[^\\]*UnitTests[^\\]*\.dll</ModulePath>
</Exclude>
</ModulePaths>
But apparently we can also pass along this as arguments but for the life of me I can't figure out how to structure it.
My last attempt was:
dotnet test --filter "TestCategory != Ignore" --no-build --no-restore -v normal --collect "Code coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.CodeCoverage.ModulePaths.Exclude.ModulePath=".*\\[^\\]*UnitTests[^\\]*\.dll"
But the above does not work ^ Using these for reference:
https://learn.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2019 https://github.com/Microsoft/vstest-docs/blob/master/docs/RunSettingsArguments.md