Code Coverage doesn't include projects not referenced by Tests Projects
@jakubch1 がすでに取り組んでいます。
2023年3月7日 から。
評価
この issue はまだ評価されていません。
説明
Description
I noticed that projects which are not referenced by Tests projects are not included in the Coverage results, is there are way to get them included? It's important to include them because that does change overall percentage.
I'm creating this since https://stackoverflow.com/questions/42013013/analyze-code-coverage-with-visual-studio-skips-some-projects has not been answered, so hopefully you can help.
I've tried many different configurations in my .runnsettings, including a recursive ModulePaths/IncludeDirectories and specifically including the missing DLL.
I've been reading the docs but didn't find any settings which could make it, did I miss anything?
Thanks!
Steps to reproduce
Solution.sln (C:\source)
ProjectA
ProjectB
TestProject
References ProjectA only
coverage.runsettings:
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Configuration>
<CodeCoverage>
<Sources>
<Include>
<Source>C:\\source\\.*</Source>
</Include>
</Sources>
<UseVerifiableInstrumentation>False</UseVerifiableInstrumentation>
<AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
<CollectFromChildProcesses>True</CollectFromChildProcesses>
<CollectAspDotNet>False</CollectAspDotNet>
</CodeCoverage>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
<RunConfiguration>
<MaxCpuCount>0</MaxCpuCount>
<BatchSize>1000</BatchSize>
<ResultsDirectory>C:\results</ResultsDirectory>
</RunConfiguration>
</RunSettings>
Once solution is built, I can see all DLLs and PDBs in their own files, and in TestsProject bin's folder only ProjectA.dll/pdb is there as expected.
Then run vstest
vstest.console.exe "C:\sources\TestProject\bin\release\TestProject.dll" /Settings:"C:\coverage.runsettings" /Logger:"trx" /TestAdapterPath:"c:\Source"
(don't think Logger and TestAdapterPath are important but that is how I've been running)
Expected behavior
.coverage included ProjectB on it, stating 0 covered blocks as that will for sure change the overall percentage
Actual behavior
ProjectB is not included, only ProjectA and TestProjects are present .
Diagnostic logs
I don't have a diag I can share now as I'm building some real projects, if really needed I can create a test solution and do it.
Environment
Microsoft (R) Test Execution Command Line Tool Version 17.0.0
- 主要言語
- C#
- スター
- 125
- フォーク
- 17
- 平均マージ
- 1時間 17分
- マージ済み PR(30日)
- 2
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/codecoverage のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
microsoft/codecoverage#246 · コメント 6 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
microsoft/codecoverage#237 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoft/codecoverage#234 · コメント 1 件 · リアクション 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
microsoft/codecoverage#233 · リアクション 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
microsoft/codecoverage#232 · コメント 6 件 ·
microsoft/codecoverage の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
nightscout/nocturne#1425 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
RayWangQvQ/BiliBiliToolPro#1137 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100