Multiple Test Results from TFS to SonarQube

945 views
Skip to first unread message

ianbf...@gmail.com

unread,
Dec 19, 2016, 2:32:56 PM12/19/16
to SonarQube
I am using on-premise TFS to send test results to SonarQube. I have multiple sets of Unit test tasks that each create a Test Result File(.trx), but when I use the End Analysis it will only grab one of the files.

So if there a way to upload multiple test files or a way to combine test result files with TFS?

I saw a similar question on stackoverflow but it was never answered - http://stackoverflow.com/questions/35863954/sonarqube-and-working-with-multiple-unit-test-reports

ppto...@gmail.com

unread,
Dec 20, 2016, 5:53:40 AM12/20/16
to SonarQube, ianbf...@gmail.com
Perhaps you could try using this:


Not sure, haven't tested :-)

- Peter

ianbf...@gmail.com

unread,
Dec 20, 2016, 2:16:58 PM12/20/16
to SonarQube, ianbf...@gmail.com, ppto...@gmail.com
Thank you, I will give this a try.

ianbf...@gmail.com

unread,
Dec 20, 2016, 4:41:30 PM12/20/16
to SonarQube, ianbf...@gmail.com, ppto...@gmail.com
I have given it a look, but from what I can see it will not do the coverage files as well. I am going to give it a try with my application, but I am not sure it will solve my issue.

ianbf...@gmail.com

unread,
Dec 21, 2016, 2:14:37 PM12/21/16
to SonarQube, ianbf...@gmail.com, ppto...@gmail.com
So I have gone through this plugin but it does not merge the coverage files node in the TRX. I did see that the sonarqube plugin for C# supports multiple code coverage files but the scanner seems to only read a trx file and use that code coverage file. Is it possible to either have a way of pulling multiple trx files or can the sonarqube scanner be used to supply multiple code coverage files to sonarqube?

Julien HENRY

unread,
Jan 3, 2017, 9:59:01 AM1/3/17
to SonarQube, ianbf...@gmail.com
Hi,

Have you tried what is mentioned in the documentation:
/d:sonar.cs.vstest.reportsPaths="%CD%\TestResults\*.trx"

http://docs.sonarqube.org/pages/viewpage.action?pageId=6389772

++

Julien

ianbf...@gmail.com

unread,
Jan 3, 2017, 2:04:09 PM1/3/17
to SonarQube, ianbf...@gmail.com
Hi Julien,

Thanks for the reply. Would that string be a Additional Settings under the Advanced Settings or can it be part of the settings file? When I read about the multiple reports before, it seemed like this was not part of the Plugin for VS build servers.

Julien HENRY

unread,
Jan 4, 2017, 3:08:19 AM1/4/17
to SonarQube, ianbf...@gmail.com
Hi,

I guess that by "Advanced Settings" you mean setting it in SonarQube server UI. If correct, then yes you should be able to define paths there.

And for the "settings file" do you mean the configuration file of the SonarQube Scanner for MSBuild? If correct then I would not try to put project specific stuff there. My example was intended to be passed to the "begin" step:

SonarQube.Scanner.MSBuild.exe begin /k:"xxx" /n:"yyy" /v:"1.0" /d:sonar.cs.vstest.reportsPaths="%CD%\TestResults\*.trx"

++

Julien

ianbf...@gmail.com

unread,
Jan 4, 2017, 9:36:55 AM1/4/17
to SonarQube, ianbf...@gmail.com
Sorry, I mis-typed in my last reply, I meant Additional Setting under Advanced in the "SonarQube Scanner for MSBuild". 

I was wondering if by SonarQube Server UI, do you mean the adminstration tab of the project on our SonarQube site?
Reply all
Reply to author
Forward
0 new messages