We have a web solution that uses both C# and javascript. I've gotten a vNext build working that compiles, and runs both C# unit tests, (VSTest task), and a javascript test, using a Jasmine package. The C# tests have been working for some time just fine. Reporting fine in SonarQube. We are just getting the developers started with Javascript, so it is the catalyst for adding a second unit test task.
Both unit test tasks run, a trx file is created by both. One of the peculiarities I've noticed is that the second test task, be it C# or javascript, delete the TestResults directory on the build server. Now this seems fine for TFS reporting, as the coverage appears to include both tests, so the upload there fine. The problem is when it tries to send the results to SonarQube, I was only getting whichever was second in the test order. Once I figured out the deletion of the first set of test results, I was able to use a powershell script to create a 2nd directory to stash the results in, until before the SonarQube end task happens. However, SonarQube doesn't seem to like the 2nd .trx file in the same directory, and picked one of the two, to upload to its server. It spits out a warning that multiple .trx files were found, and picks one to process.
I did find a some information on a Sonar parameter that could be passed in, sonar.cs.vstest.reportPath=. Sonar does pick up the file in the original TestResults folder, but only appears to mention the second, stash directory, as in passing, FYI, not doing anything with it.
I've also tried using a merge process to put the two .trx files together, but SonarQube doesn't see any of the unit tests results when I do that.
My main question here, is there a better way to run two sets of test tasks, with differing languages and runners, and have the results appear in SonarQube in the same project report? Am I attempting something that shouldn't be done, or is there a better way to go about what I'm doing?