MicrosoftPremier / VstsExtensions

Documentation and issue tracking for Microsoft Premier Services Visual Studio Team Services Extensions
MIT License
56 stars 14 forks source link

Build quality check - waiting for code coverage data in Azure DevOps #189

Closed seshadrimr closed 1 year ago

seshadrimr commented 1 year ago

Hi. I created a DevOps starter project on Azure DevOps. Brought in a simple .Net core WebApi with Unit test. I wanted to break the build if the code coverage is lesser than a configurable value. Hence I added 'Build quality check' task after the .Net Core 'Test' task. It validates the code configuration policy and always says 'Waiting for Code Coverage data'. It breaks since the Maximum timeout reaches. Am I missing some setting here? From where does the task look for the Code coverage data? I also have 'Prepare code analysis' for SonarCloud task. The code coverage data gets reflected in SOnarCloud. I added the argument '--collect "Code coverage"' in the 'Test' task.

Please guide me in this problem. Attached the pipeline steps.

image

ReneSchumacher commented 1 year ago

Hi @seshadrimr,

if you're using SonarQube, you could create a code coverage quality gate in there as well, so you don't need the Build Quality Checks task just to check a code coverage threshold. For more complex scenarios like comparing with previous builds, I guess BQC is needed, but I'm not that familiar with all the quality gates in SonarQube.

Afaik, the .NET Core task may not publish code coverage data to Azure DevOps. Can you please check if you see coverage values on the build summary page like this:

image

If not, please check if the option to publish test results and code coverage is checked in the test task:

image

ReneSchumacher commented 1 year ago

@seshadrimr Is this issue still active? Since there wasn't any feedback since end of July, I would close this issue end of this month unless you still need it.

kieseldlds commented 1 year ago

We are seeing the same issue. Our coverage results are being published and can be seen in the test results but we get the following on the coverage quality check.

image
ReneSchumacher commented 1 year ago

Hi @kieseldlds,

can you see the coverage results on the build summary page as shown in my post above? If so, can you please run the build again with the variables System.Debug and BQC.LogRawData set to true and send the logs to PSGerExtSupport@microsoft.com, so I can take a look?

The error message (ECONNRESET) points to a communication issue (a connection reset). This might be caused by many different things. Are you perhaps using a proxy server? Or an unstable connection to Azure DevOps?

ReneSchumacher commented 1 year ago

Hi @kieseldlds,

I'm closing this issue now since I have not received any updates since January. If you need additional assistance, feel free to comment again on the closed issue or open a new one.