我的 SonarQube 报告中包含的 Blazor 组件源文件的代码覆盖率为 0%



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

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

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

我的扫描仪命令:

dotnet "C:Program Filessonar-scannerSonarScanner.MSBuild.dll" begin /k:"My-Project" /d:sonar.cs.opencover.reportsPaths="Testscoverage.opencover.xml"
dotnet build
dotnet "C:Program Filessonar-scannerSonarScanner.MSBuild.dll" end

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

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

最新更新