vladopajic / go-test-coverage

go-test-coverage is tool and github action which reports issues when test coverage is below set threshold
GNU General Public License v3.0
80 stars 10 forks source link

feat: coverage diff change #42

Open vladopajic opened 10 months ago

vladopajic commented 10 months ago

some developers prefer to see coverage difference change on their PRs. go-test-coverage could be extended to allow such functionality for those who want it.

1) give new option which will show error if coverage difference from base branch is below threshold. diff-threshold property will set allowed threshold for coverage difference (in percentage) from base branch. for example, if this property is set to to 5 (meaning 5%), error will be shown if current PR doesn't have at least 5% more code covered. similar, if value is set to -5, PR will be allowed to have up to 5% less covered code then base branch. this property will stack with other rules.

2) give new option to post comment on PR with coverage difference. diff-comments property will control if GitHub action will post comments on PR with coverage difference.