Skip to content

GitLab CI / CD settings for displaying test coverage report output in ASP.NET Core applications.

Notifications You must be signed in to change notification settings

barisates/dotnet-core-gitlab-ci-cd-settings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

dotnet-core-gitlab-ci-cd-settings

GitLab CI / CD settings for displaying test coverage report output in ASP.NET Core applications.

Coverlet

We use Coverlet for code coverage report. It allows us to integrate GitLab CI / CD by displaying the report output on the console. For detailed knowledgeable; Coverlet.

Coverlet should only be added to your test projects!

Latest stable version: NuGet

MSBuild Integration:

dotnet add package coverlet.msbuild

Coverlet output on Gitlab CI / CD:

Coverlet output on Gitlab CI / CD

GitLab CI / CD

To manage the GitLab CI / CD process, we need knowledge of the project's code coverage report about testing. After adding the Coverlet package to our test project, we make GitLab CI / CD settings.

Test stage script for .gitlab-ci.yml file:

test:
  stage: test
  script:
    - dotnet test /p:CollectCoverage=true

Test coverage parsing:

Total[^|]*\|[^|]*\s+([\d\.]+)

Coverage report badge:

Coverage report badge

About

GitLab CI / CD settings for displaying test coverage report output in ASP.NET Core applications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published