1
votes

Good day,

I followed this guide to set-up integration of Azure DevOps and SonarCloud: https://docs.microsoft.com/en-us/labs/devops/sonarcloudlab/index

Everything goes well, I was able to setup build on master branch as well as builds on PRs. One thing that was missing out of the box from this guide is sending Test Coverage results to the SonarCloud (at least for the .NET Core projects, I used ".NET Core with SonarCloud" tamplate).

I found another guide on how we could convert standart .trx report to the .xml one and upload it to the SonarCloud: https://yuriburger.net/2018/09/10/getting-coverage-reports-with-net-core/

But faced another issue with PowerShell command in AzureDevOps, it can't get a reference to the $(Agent.TempDirectory) variable during the execution: https://github.com/yuriburger/net-cover-demo/issues/1

Maybe someone faced the similar problem? Or maybe can suggest another way how I could send Test Coverage results to the SonarCloud?

Thanks!

1
Do you use PowerShell inline or from a file?Shayki Abramczyk
Hi Shayaki, from a fileRoman Borysenok
Ok, so replace the variables according my answer below.Shayki Abramczyk

1 Answers

1
votes

Because you use the PS script from a file you need to use the variable in this way:

$env:Agent.TempDirectory