Skip to content

BuildQualityChecks - Code Coverage checks should run per file (not averaged) #219

@CIPop

Description

@CIPop

Describe the context

  • Extension: BuildQualityChecks
  • Environment: Azure DevOps Services (cloud)
  • Pipeline type: yaml

Describe the problem and expected behavior

C code coverage analyzer makes an average for the entire project.
The expectation is that each file is over the required limits across the project.

E.g. for a good project where current coverage is 90%, adding a few small files with 0% coverage will result in a passing CI gate (reducing the coverage to let's say 80%).

The problem this creates is that new files must now have more coverage than expected.

Example from our https://github.com/Azure/azure-sdk-for-c repo:

image

Our yaml is:

  - task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@6
    displayName: Check line coverage
    inputs:
      checkCoverage: true
      coverageFailOption: fixed
      coverageType: line
      # 90% minimum line coverage
      coverageThreshold: 90
    condition: eq(variables['AZ_SDK_CODE_COV'], 1)

  - task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@6
    displayName: Check branch coverage
    inputs:
      checkCoverage: true
      coverageFailOption: fixed
      coverageType: branch
      # 70% minimum branch coverage
      coverageThreshold: 70
    condition: eq(variables['AZ_SDK_CODE_COV'], 1)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions