【问题标题】:0% Code Coverage of Blazor component source file included in my SonarQube report我的 SonarQube 报告中包含的 Blazor 组件源文件的代码覆盖率为 0%
【发布时间】:2020-12-15 21:54:02
【问题描述】:

我有一个包含许多组件的 Blazor 应用程序。在 Visual Studio 上为这些组件运行单元测试会给我完整的覆盖率报告。 作为使用 MSBuild Scanner 使用 SonarQube 扫描代码,我的单元测试命令是:

dotnet test .\Tests\App.Test.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --logger trx

但在我的 SonarQube Web 报告中,Blazor 代码覆盖率为 0%。

我的扫描仪命令:

 dotnet "C:\Program Files\sonar-scanner\SonarScanner.MSBuild.dll" begin /k:"My-Project" /d:sonar.cs.opencover.reportsPaths="Tests\coverage.opencover.xml"

dotnet build

dotnet "C:\Program Files\sonar-scanner\SonarScanner.MSBuild.dll" end

我想知道我的配置文件 SonarQube.Analysis.xml 中是否缺少任何项目。

【问题讨论】:

标签: sonarqube blazor sonarqube-scan


【解决方案1】:

不幸的是,SonarQube 还没有分析 Blazor 文件。所以它不会处理您的覆盖率报告的结果。

【讨论】:

    猜你喜欢
    • 2020-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-09-27
    相关资源
    最近更新 更多