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

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

问题描述

我正在使用Visual Studio Team Services进行自动构建,并使用SonarQube显示代码质量,覆盖范围等.我还使用了私有托管的构建代理.

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

因此,当VSTS构建解决方案时,它将在此处创建测试结果文件:C:\ agent_work \ 3 \ s \ TestResults

但是SonarQube试图从此处使用测试结果:C:\ agent_work \ 3 \ TestResults

在构建服务器上,如果我手动将.trx文件复制到正确的位置,然后再次运行该构建,则代码覆盖范围都可以正常工作,并一直处理到SonarQube.因此,问题绝对是.trx的发布位置和将其提取的位置不匹配.

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

请帮助!

解决方案

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

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

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.

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.

So when VSTS builds the solution it creates the test results file here: C:\agent_work\3\s\TestResults

But SonarQube is trying to use test results from here: C:\agent_work\3\TestResults

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.

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

Please help!

解决方案

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

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天全站免登陆