如何解决dotnet test Runsettings 参数以从代码覆盖率中排除单元测试
所以我能够提供运行设置并且有效
dotnet test --filter "TestCategory != Ignore" --no-build --no-restore -v normal --collect "Code coverage" -s *.runsettingss
其中包括:
<ModulePaths>
<Include>
<ModulePath>.*\.dll$</ModulePath>
<ModulePath>.*\.exe$</ModulePath>
</Include>
<Exclude>
<ModulePath>.*\\[^\\]*UnitTests[^\\]*\.dll</ModulePath>
</Exclude>
</ModulePaths>
但显然我们也可以将其作为参数传递,但对于我的生活,我无法弄清楚如何构建它。
我最后一次尝试是:
dotnet test --filter "TestCategory != Ignore" --no-build --no-restore -v normal --collect "Code coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.CodeCoverage.ModulePaths.Exclude.ModulePath=".*\\[^\\]*UnitTests[^\\]*\.dll"
但是上面的方法不起作用^ 使用这些作为参考:
https://docs.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2019 https://github.com/Microsoft/vstest-docs/blob/master/docs/RunSettingsArguments.md
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。