atifaziz / NCrontab

Crontab for .NET
Apache License 2.0
913 stars 139 forks source link

Add test coverage collection & reporting #115

Closed atifaziz closed 1 year ago

atifaziz commented 1 year ago

This PR adds test coverage collection & reporting during a CI build as well as locally runnable test scripts (test.cmd/test.sh). When the test script finishes running, a summary as follows is printed:

Summary
  Generated on: 13/06/2023 - 18:18:42
  Coverage date: 13/06/2023 - 18:03:24 - 13/06/2023 - 18:18:41
  Parser: MultiReport (12x Cobertura)
  Assemblies: 1
  Classes: 5
  Files: 5
  Line coverage: 88.3%
  Covered lines: 380
  Uncovered lines: 50
  Coverable lines: 430
  Total lines: 1039
  Branch coverage: 79.7% (169 of 212)
  Covered branches: 169
  Total branches: 212
  Method coverage: 79.7% (55 of 69)
  Covered methods: 55
  Total methods: 69

NCrontab                          88.3%
  NCrontab.CrontabException       66.6%
  NCrontab.CrontabField           69.7%
  NCrontab.CrontabFieldImpl       89.7%
  NCrontab.CrontabSchedule        99.4%
  NCrontab.StringSeparatorStock  100.0%

The script generates detailed HTML report of the the code coverage into etc/coverage and the CI build publishes it as a downloadable artifact. Another online browsable report should also be available on Codecov.