如何将天蓝色管道测试结果发布到SonarCloud

问题描述 投票:0回答:1

我需要将我的测试覆盖率结果发布到SonarCloud中。我当前的管道是这个enter image description here

更新:-在运行代码分析步骤中,可以找到此日志。但是在SonarCloud中,不会显示覆盖结果。

INFO: Parsing the Visual Studio coverage XML report D:\a\1\.\TestResults\VssAdministrator_fv-az185_2019-11-13_11_15_46\In\fv-az185\VssAdministrator_fv-az185 2019-11-13 11_15_34.coveragexml
INFO: Adding this code coverage report to the cache for later reuse: D:\a\1\.\TestResults\VssAdministrator_fv-az185_2019-11-13_11_15_46\In\fv-az185\VssAdministrator_fv-az185 2019-11-13 11_15_34.coveragexml
INFO: Coverage Report Statistics: 21 files, 20 main files, 20 main files with coverage, 1 test files, 0 project excluded files, 0 other language files.
azure-devops azure-pipelines-build-task
1个回答
0
投票

如何将天蓝色管道测试结果发布到SonarCloud

根据文档:

From Team Foundation Server 2015 or Visual Studio Team Services

  1. 可选:要将代码覆盖率导入SonarQube,请在生成第一个之后添加Visual Studio Test生成任务,然后勾选代码覆盖率启用

因此,请确保您已在VsTest任务中选中启用代码覆盖率

此外,如果您已经选择了该选项,则可以检查SonarQube的版本是否为6.5,该版本存在问题:

SonarQube 6.5 – Code Coverage Result is not displayed

希望这会有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.