Skip to content

Conversation

@jcouball
Copy link
Member

@jcouball jcouball commented Jan 20, 2024

Summary

Add env options when running spec tests:

  • COV_NO_FAIL=TRUE to not fail if coverage falls below the threshold
  • COV_SHOW_UNCOVERED=TRUE to list all lines not covered by the test run

Details

Coverage below the threshold will cause the rspec run to fail unless the COV_NO_FAIL environment variable is set to TRUE.

COV_NO_FAIL=TRUE rspec

Example of running the tests in an infinite loop writing failures to fail.txt:

while true; do COV_NO_FAIL=TRUE rspec >> fail.txt; done

The lines missing coverage will be displayed if the COV_SHOW_UNCOVERED environment variable is set to TRUE.

COV_SHOW_UNCOVERED=TRUE rspec

@jcouball jcouball changed the title Update spec/spec_helper.rb to match other projects Add env coverage options to use when running rspec Jan 20, 2024
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit f304166 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 100.0% (0.0% change).

View more on Code Climate.

@jcouball jcouball merged commit cf1dd7c into main Jan 20, 2024
@jcouball jcouball deleted the update_spec_helper branch January 20, 2024 21:32
@jcouball jcouball mentioned this pull request Jan 20, 2024
@jcouball jcouball mentioned this pull request May 7, 2024
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.

2 participants