0
votes

I'm using SonarCloud with AzureDevops.

The sequence in my YAML file is:

  1. Restore NuGet
  2. Sonar Prepare
  3. Build solution
  4. Run tests
  5. Sonar Analyze
  6. Sonar Publish

I don't specify any output locations (at least, not knowingly).

When the tests run, I get the following output:

Test results files: d:\a_temp\TestResults\VssAdmin.....trx

But when the Sonar Analysis step executes, I get the following output:

Looking for TRX files in: d:\a\1\TestResults

So....the paths don't match.

Do I:

  • tell Azure to write the tests to a different folder?
  • or, do I tell Sonar where to find the test results?

I'm guessing the second option might be easier - in a different solution I've not yet set up, there are many test projects....

Thanks

1

1 Answers

1
votes

That's because in VSTest task, test results are stored in $(Agent.TempDirectory)/TestResults by default. You could change it to $(Common.TestResultsDirectory).

enter image description here