q2ebanking / boa-constrictor

Boa Constrictor is a C# implementation of the Screenplay Pattern. Its primary use case is Web UI and REST API test automation. Boa Constrictor helps you make better interactions for better automation!
https://q2ebanking.github.io/boa-constrictor/
Other
119 stars 41 forks source link

Add code coverage report to unit-tests.yml GitHub Action #24

Open AndyLPK247 opened 4 years ago

AndyLPK247 commented 4 years ago

This is a follow-up to #18. It would be nice to run code coverage and share the report.

Check out this article: https://codeburst.io/code-coverage-in-net-core-projects-c3d6536fd7d7

Questions:

CoffeeAtBedtime commented 1 year ago

In this article https://samlearnsazure.blog/2021/01/05/code-coverage-in-github-with-net-core/ the output format for coverlet is set to lcov and he adds it to the pipeline

`- name: Run automated unit and integration tests
  run: dotnet test FeatureFlags/FeatureFlags.Tests/FeatureFlags.Tests.csproj  /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov`

Sends it up to https://coveralls.io

`- name: Publish coverage report to coveralls.io   
  uses: coverallsapp/github-action@master   
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }} 
    path-to-lcov: FeatureFlags/FeatureFlags.Tests/TestResults/coverage.info`

Then has a nice coverage badge