【问题标题】:No coveragexml files in Scanner for MSBuild through VSTS extensionScanner for MSBuild 中没有通过 VSTS 扩展的 coveragexml 文件
【发布时间】:2018-08-30 17:29:30
【问题描述】:

使用: TFS 2017 更新-2 VS2015 VSTS 任务 3.2.0 SonarQube 5.6.6 LTS

在将 SonarQube Extension 从 4.0.2 升级到 4.1 后,我们在运行“Scanner for MSBuild - End Analysis”任务时收到警告。

我们注意到 codecoverage.xml 文件不是由代码覆盖工具生成的(请参阅下面的日志记录)。

这仅适用于安装了 VS2015 的 TFS 代理,它适用于与 VS2017 相同的设置。

我们应用了解决方法:SonarQube Code Coverage from VSTS 我们将 /d:sonar.cs.vscoveragexml.reportsPaths=**/*.coveragexml 放在任务“Scanner for MSBuild - Begin Analysis”的附加设置中 但是仍然没有生成codecoverage.xml文件

是否有其他解决方法或解决方案?

2018-03-21T10:01:20.7772938Z ##[section]Starting: Complete the SonarQube analysis
2018-03-21T10:01:20.7929236Z ==============================================================================
2018-03-21T10:01:20.7929236Z Task         : Scanner for MSBuild - End Analysis
2018-03-21T10:01:20.7929236Z Description  : [DEPRECATED] Use new version of the task
2018-03-21T10:01:20.7929236Z Version      : 3.2.0
2018-03-21T10:01:20.7929236Z Author       : SonarSource
2018-03-21T10:01:20.7929236Z Help         : [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2018-03-21T10:01:20.7929236Z ==============================================================================
2018-03-21T10:01:20.7929236Z Preparing task execution handler.
2018-03-21T10:01:21.1835551Z Executing the powershell script: C:\TFS\Agent\_work\_tasks\SonarQubeScannerMsBuildEnd_6d01813a-9589-4b15-8491-8164aeb38055\3.2.0\SonarQubePostTest.ps1
2018-03-21T10:01:22.3867151Z WARNING: ------------------------------------------------------------------------
2018-03-21T10:01:22.3867151Z This executable is deprecated and may be removed in next major version of the SonarScanner for MSBuild. Please use 'SonarScanner.MSBuild.exe' instead.
2018-03-21T10:01:22.3867151Z ------------------------------------------------------------------------
2018-03-21T10:01:22.3867151Z SonarScanner for MSBuild 4.1
2018-03-21T10:01:22.3867151Z Using the .NET Framework version of the Scanner for MSBuild
2018-03-21T10:01:22.3867151Z Default properties file was found at C:\TFS\Agent\_work\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\3.2.0\SonarQubeScannerMsBuild\SonarQube.Analysis.xml
2018-03-21T10:01:22.3867151Z Loading analysis properties from C:\TFS\Agent\_work\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\3.2.0\SonarQubeScannerMsBuild\SonarQube.Analysis.xml
2018-03-21T10:01:22.3867151Z Post-processing started.
2018-03-21T10:01:22.3867151Z 11:01:21.761  11:01:21.746  WARNING: Failed to find the code coverage command line tool. Possible cause: Visual Studio is not installed, or the installed version does not support code coverage.

【问题讨论】:

    标签: tfs msbuild sonarqube code-coverage


    【解决方案1】:

    #461 Failure to find VS2015 CodeCoverage.exe after searching for nonexistent registry key 中正在跟踪此问题,其中列出了已知的解决方法(即手动添加注册表项,或使用 VS2017 构建)。

    如果构建代理同时安装了 VS2015 和 VS2017,它也应该可以工作 - 可以使用 VS2015 执行构建,但扫描器结束步骤应该检测并使用 VS2017 版本的代码覆盖工具。

    【讨论】:

    • @PGGM-IT4IT 感谢您的反馈,如果解决方案有效,感谢marking it as an answer,这也将帮助社区中的其他人。只需单击答案旁边的复选标记即可将其从空心切换为绿色。
    • @PatrickLu-MSFT 该错误应该在今天发布的 SonarQube VSTS 扩展的 4.1.1 版中修复:marketplace.visualstudio.com/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-26
    • 1970-01-01
    • 2016-05-29
    • 2019-05-20
    • 2016-07-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多