Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect code coverage and enforce minimum coverage on CI #11

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rmacklin
Copy link
Contributor

@rmacklin rmacklin commented Nov 1, 2020

This PR adds simplecov and uses it to measure code coverage and enforce test coverage on CI.

Example coverage report screenshots

image

image

This will be used to measure code coverage
@rmacklin rmacklin force-pushed the measure-code-coverage branch 2 times, most recently from 548bcba to cef5ad2 Compare November 1, 2020 05:18
@rmacklin rmacklin marked this pull request as draft November 1, 2020 16:09
Coverage will only be measured if the `MEASURE_COVERAGE=true`
environment variable is set. We'll set that on CI, but for local runs we
won't need to collect code coverage every single time we run the tests.
Let's prevent our test coverage from dropping
The coverage report will be uploaded as an artifact so that anyone can
inspect the results.
@rmacklin rmacklin force-pushed the measure-code-coverage branch from cef5ad2 to 8729d49 Compare November 1, 2020 17:30
@rmacklin rmacklin marked this pull request as ready for review November 1, 2020 17:32
We don't need to measure coverage for each run since we don't have logic
that's conditional on the ruby version or the rack version. Furthermore,
it seems like when all of the jobs try to upload the coverage artifact,
some of them fail with
```
Error: Unexpected response. Unable to upload chunk to https://pipelines.actions.githubusercontent.com/Rno49s13pA5vllnyZeZXc7qQF0b4Jq8BZ4WgDbFQX4NocZwQsY/_apis/resources/Containers/14397?itemPath=code-coverage-report%2Fassets%2F0.12.3%2Fcolorbox%2Floading.gif
```
as seen in
https://github.com/miyagawa/rack-vcr/runs/1337619960?check_suite_focus=true

So, let's only measure coverage for the job running the latest ruby and
rack versions.
@rmacklin rmacklin force-pushed the measure-code-coverage branch from 8729d49 to 79242ec Compare November 1, 2020 19:01
@rmacklin
Copy link
Contributor Author

@miyagawa Any interest in this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant