We’re experiencing higher build time for Test project if SonarcloudAnalysis is on since 03/08, before that it was usually taking about 2-3min but since this date it jump to 40+ min.
We tried to revert back our code changes to see if it’s related to our code changes with no luck, even if we are running an old PR which took less time prior to this date but now its build time is on higher side
We did some changes in SonarCloud Profile for the project but only thing we did, just created a new profile inherited it with Default SonarCloud Profile
Would like to know if you guys released anything same time which can affect this, if not could any of you please help out, would highly appreciate
Can you make sure that you are using SonarScanner for .NET 5.1 ? Version may be found on the header of the logs for that task.
If yes, we stopped categorising TestProject by their name (*Test). Is that you case ? If yes, this might be a reason why your project is now categorised as Product Code, so then iit’s analyzed by SonarCloud.
If you don’t want it to be analyzed, you can add either the true property in your csproj, or true
Thanks for the quick response, few thing I would like to confirm
Can you make sure that you are using SonarScanner for .NET 5.1 ? Version may be found on the header of the logs for that task. - I couldn’t find it in Header, hope you’re referencing this Header(Attached screen)
If you don’t want it to be analyzed, you can add either the true property in your csproj, or true - I didn’t get which property inside .csproj I’ve to marked as true also I’m hoping after making this change our code coverage, quality gate and analysis will work as before
You’ll find the version in either Prepare analysis configuration or Run Code analysis task for SonarCloud, in fact it’s a bit below the header at the beginning of the logs (few first lines).
For the property, you’ll have to create it since it doesn’t exist (it’s set on the fly by us or the value is read if it’s found inside one csproj).
For the property, you’ll have to create it since it doesn’t exist (it’s set on the fly by us or the value is read if it’s found inside one csproj). For this Could you please send it to me with complete syntax and place to put in so that I can make changes and try
@mickaelcaro
Made this change in Main Website Test project which is referencing all other test projects(hope I don’t have to update .csproj for all test projects) but still result is same
@mickaelcaro Are you seeing some warning on your test projects as well in the logs ? - Yes, almost 4284, more than the website project warning
In SonarCloud dashboard, do you see your test projects analyzed with their lines of code displayed ? - Not Sure how can I verified this, could you please share the steps and it should be verified against master repository or the branch where we have recent csproj changes
Just go to the “Code” tab of your project on SonarCloud, you may see all the sources and eventually the test projects. But seeing the warning i think they are detected as product code.
Could you please send me the logs of the build task ? i would need them in diagnostic verbosity, so that i can see where our detection is failing.