VSTS SonarQube 找不到 TRX 文件 [英] VSTS SonarQube cannot find TRX file

查看:20
本文介绍了VSTS SonarQube 找不到 TRX 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Visual Studio Team Services 执行自动构建,并使用 SonarQube 显示代码质量、覆盖率等.我还使用私人托管的构建代理.

I am using Visual Studio Team Services to carry out an automated build, and using SonarQube to display Code Quality, Coverage, etc. I am also using a privately hosted build agent.

所有构建步骤都可以成功处理数据并填充到 SonarQube,这很棒.但是,SonarQube 中没有显示代码覆盖率.查看 VSTS 中的日志后,我发现 SonarQube 正在与 VSTS 将 .trx 文件发布到的目录不同的目录中查找 .trx 文件(其中包含代码覆盖率).

The build steps all work successfully with data being processed and populated through to SonarQube which is great. However, no code coverage is being displayed in SonarQube. After looking through the logs in VSTS I found that SonarQube is looking for the .trx file (which contains code coverage) in a different directory to the one that VSTS publishes the .trx file to.

因此,当 VSTS 构建解决方案时,它会在此处创建测试结果文件:C:agent_work3sTestResults

So when VSTS builds the solution it creates the test results file here: C:agent_work3sTestResults

但 SonarQube 正在尝试使用此处的测试结果:C:agent_work3TestResults

But SonarQube is trying to use test results from here: C:agent_work3TestResults

在构建服务器上,如果我手动将 .trx 文件复制到正确的位置,然后再次运行构建,则代码覆盖率一切正常,并通过 SonarQube 进行处理.因此,问题肯定是 .trx 的发布位置与获取表格的位置不匹配.

On the build server, if I manually copy the .trx file into the correct location and then run the build again, the code coverage all works fine and processes through to SonarQube. So the issue is definitely the mismatch of the locations where the .trx is published and where it is to be picked up form.

我找不到更改发布位置或 SonarQube 源位置的方法.

I can't find a way of changing the publish location, or the SonarQube source location.

请帮忙!

推荐答案

这是一个已知问题,将在下一个版本中修复.请参阅:https://jira.sonarsource.com/browse/SONARMSBRU-262.

This is a known issue, and will be fixed by the next release. See: https://jira.sonarsource.com/browse/SONARMSBRU-262.

我们刚刚发布了具有此修复程序的产品的 RC 版本,您可以尝试一下.请参阅此线程.

We just announced the RC versions of the products that have this fix, you can give them a try. See this thread.

这篇关于VSTS SonarQube 找不到 TRX 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆