Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coverage status check failed?

I committed the changes to the pull request and yt shows

"Code coverage status failed.".

I have searched a lot, but couldn't find the cause or solution to resolve this.

Azure pipeline test service 
Diff coverage check failed.0/70 (0.00 %) changed lines are covered up to update 2. Diff coverage target is 70.00 %. 

Verification build is successful but the status is showing code coverage has failed.

like image 676
prasanthi Avatar asked Jul 26 '19 07:07

prasanthi


People also ask

What is coverage status check in Azure DevOps?

The status check evaluates the diff coverage value for all the code files in the pull request. If you would like to view the % diff coverage value for each of the files, you can turn on details as mentioned in the configuration section.

How do I check code coverage in Ado?

The code coverage summary can be viewed on the Summary tab on the pipeline run summary. The results can be viewed and downloaded on the Code coverage tab.

How do I enable Azure DevOps code coverage?

As already explained in my previous article, the very first thing to do to add code coverage calculation is to install a NuGet package called Coverlet. This package must be installed in every test project in your Solution. So, running a simple dotnet add package coverlet. msbuild on your test projects is enough!

How do you use SonarQube in Azure DevOps?

In Azure DevOps, go to Project Settings > Service connections. Click New service connection and select SonarQube from the service connection list. Enter your SonarQube Server URL, an Authentication Token, and a memorable Service connection name. Then, click Save.


1 Answers

Create an azurepipelines-coverage.yml config file at the root of your repo with any of the following:

coverage:
  status: off     #default on

Turning this off will not post any coverage checks and coverage annotations will not appear in the changed files view.


coverage:
  status:
    diff:
      target: 30%     default 70%

Target threshold value for diff coverage must be met for a successful coverage status to be posted.


coverage:
  status:
    comments: on    #default off

Indicates whether a comment containing coverage details for each code file should be posted in the pull request


Microsoft Docs; Configuring coverage settings

like image 186
ArtiomLK Avatar answered Sep 28 '22 06:09

ArtiomLK