-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current coverage value always lower than baseline coverage value [was: Different baseline coverage data] #112
Comments
Hi @fsdschmidt, could you post the configuration of the Build Quality Checks task here or send it to PSGerExtSupport@microsoft.com so we know exactly how coverage evaluation is configured? And do you have multiple test runs in your pipeline? If you do, Azure DevOps aggregates coverage values (at least from the VSTest task) so the result might depend on the time you read the value from the service. Coverage values shown in the Code Coverage tab of the build summary can differ from the values our policy shows. It should only happen for non-VSTest test runs though. I know that there is a bug in the Cobertura report generation of IstanbulJS. Thus, if you're running tests for JavaScript/TypeScript, you will most likely see different coverage values in the Code Coverage tab. If you like you can also send us the logs from the baseline build and the current build so we can dig deeper. René |
Hi René, thanks for your fast reply. I will offer some details of our build configuration (TFS without yaml). We have multiple test tasks in two parallel agents: Agent 1: Agent 2: After completion of both build agents we have one final agent which performs the test quality check for whole build: Which logs would be interesting for an deeper analysis? |
Hi again, sorry for the delay. Just to confirm my understanding: you have one build pipeline with three agent jobs:
Is that correct? While this setup should work, we've never explicitly tested it. Is this an intermittent issue or does it consistently occur? To fully understand what's going on I would need the logs of all three builds (the "current" build from your first post, the baseline of the current build with ID 97635, and the baseline of the baseline build with ID 97599). It would also help if you ran your builds with the variables Since those logs may contain sensitive data (e.g., URLs of your TFS instance, project names, etc.) I'd recommend sending them via email to PSGerExtSupport@microsoft.com and/or removing sensitive information from the logs. |
Yes this is correct. For faster builds we run server and client build in parallel. But afterwards we want to have only one coverage info, so that's job of agent 3. The issue occurs consistently on our master branch and the related build. It works on further branches and builds, but at this point I don't understand why. For further analyses I´ve sent some logs via email. |
This issue was caused by the asynchronous processing of coverage data in Azure DevOps paired with an issue in the processing jobs causing them to report the wrong status for the backend process. Due to this wrong status, the Build Quality Checks task reads premature coverage data that hasn't been fully aggregated, causing it to use only part of the coverage data for policy evaluation. If BQC is always reporting lower coverage than there actually is, you can add a task that runs before BQC to delay policy evaluation. The simplest workaround is adding a PowerShell task with the following inline script: |
We have some trouble with coverage comparison. For example our current build successfully detected a baseline build:
Found baseline build with ID 97635.
Successfully read code coverage data from build.
Evaluating coverage data from 1 filtered code coverage data sets...
Total lines: 75747
Covered lines: 37405
Code Coverage (%): 49.3815
Unfortunately the detected baseline code coverage % ist wrong, to high and above our variance. Here is the quality check of baseline build with ID 97635:
Validating code coverage policy...
Successfully read code coverage data from build.
Evaluating coverage data from 1 filtered code coverage data sets...
Total lines: 75641
Covered lines: 36932
Code Coverage (%): 48.8254
Found baseline build with ID 97599.
Successfully read code coverage data from build.
Evaluating coverage data from 1 filtered code coverage data sets...
Total lines: 75747
Covered lines: 37408
Code Coverage (%): 49.3855
For any reason the detected coverage in a later comparison build is higher than the original one. And also total lines differ. TFS reports a coverage of 49.3 % (summary page), may be 48.8 % of the current build is wrong? We use line coverage.
The text was updated successfully, but these errors were encountered: