Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Optional exit code > 0 when coverage percentage goes down #11

Closed
colszowka opened this Issue · 3 comments

3 participants

@colszowka
Owner

See http://twitter.com/#!/hayafirst/status/28368786944

And my responses:
Check out custom exit behaviour: http://bit.ly/953iOR - could raise an exception after result change. See http://bit.ly/9PSaOt
Basically, cache the result.covered_percent somewhere, then later compare it with previous and cause an exit with status > 0


This could be an (optional) built-in functionality.
The SimpleCov.result.covered_percent should be stored in coverage_path/last_coverage_percent, then compared with the current run.

Configure with:

SimpleCov.start(:rails) do
  check_coverage_change 
end
@ywen

This will be awesome. Thank you. Do you feel it is hard or relatively easy? I would love to help if I may.

@dlindahl

Not sure how this would work when bounding between filtered and unfiltered specs as the coverage amount would change between test runs.

However, you may want to checkout cane from Square. It is a code quality tool that specifically allows for build failures when code coverage drops below a certain amount.

@colszowka
Owner

This will be very easy to add now that #90 is part of master, basically I'd just add a refuse_coverage_drop config shorthand that under the hood uses maximum_coverage_drop 0.

@colszowka colszowka closed this in 40d3593
@jperkin jperkin referenced this issue from a commit in joyent/pkgsrc
taca Update ruby-simplecov.
Make this package to Ruby 1.9.3 only.

v0.7.1, 2012-10-12 ([changes](colszowka/simplecov@v0.7.0...v0.7.1))
-------------------

  * [BUGFIX] The gem packages of 0.7.0 (both simplecov and simplecov-html) pushed to Rubygems had some file
    permission issues, leading to problems when installing SimpleCov in a root/system Rubygems install and then
    trying to use it as a normal user (see colszowka/simplecov#171, thanks @envygeeks
    for bringing it up). The gem build process has been changed to always enforce proper permissions before packaging
    to avoid this issue in the future.


v0.7.0, 2012-10-10 ([changes](colszowka/simplecov@v0.6.4...v0.7.0))
-------------------

  * [FEATURE] The new `maximum_coverage_drop` and `minimum_coverage` now allow you to fail your build when the
    coverage dropped by more than what you allowed or is below a minimum value required. Also, `refuse_coverage_drop` disallows
    any coverage drops between test runs.
    See colszowka/simplecov#151, colszowka/simplecov#11,
    colszowka/simplecov#90, and colszowka/simplecov#96 (thanks to @infertux)
  * [FEATURE] SimpleCov now ships with a built-in MultiFormatter which allows the easy usage of multiple result formatters at
    the same time without the need to write custom wrapper code.
    See colszowka/simplecov#158 (thanks to @nikitug)
  * [BUGFIX] The usage of digits, hyphens and underscores in group names could lead to broken tab navigation
    in the default simplecov-html reports. See colszowka/simplecov-html#14 (thanks to @ebelgarts)
  * [REFACTORING] A few more ruby warnings removed. See colszowka/simplecov#106 and
    colszowka/simplecov#139. (thanks to @lukejahnke)
  * A [Pledgie button](colszowka/simplecov@63cfa99) for those that
    feel generous :)
  * The usual bunch of README fixes and documentation tweaks. Thanks to everyone who contributed those!
9027cf8
@jsonn jsonn referenced this issue from a commit in jsonn/pkgsrc
taca Update ruby-simplecov.
Make this package to Ruby 1.9.3 only.

v0.7.1, 2012-10-12 ([changes](colszowka/simplecov@v0.7.0...v0.7.1))
-------------------

  * [BUGFIX] The gem packages of 0.7.0 (both simplecov and simplecov-html) pushed to Rubygems had some file
    permission issues, leading to problems when installing SimpleCov in a root/system Rubygems install and then
    trying to use it as a normal user (see colszowka/simplecov#171, thanks @envygeeks
    for bringing it up). The gem build process has been changed to always enforce proper permissions before packaging
    to avoid this issue in the future.


v0.7.0, 2012-10-10 ([changes](colszowka/simplecov@v0.6.4...v0.7.0))
-------------------

  * [FEATURE] The new `maximum_coverage_drop` and `minimum_coverage` now allow you to fail your build when the
    coverage dropped by more than what you allowed or is below a minimum value required. Also, `refuse_coverage_drop` disallows
    any coverage drops between test runs.
    See colszowka/simplecov#151, colszowka/simplecov#11,
    colszowka/simplecov#90, and colszowka/simplecov#96 (thanks to @infertux)
  * [FEATURE] SimpleCov now ships with a built-in MultiFormatter which allows the easy usage of multiple result formatters at
    the same time without the need to write custom wrapper code.
    See colszowka/simplecov#158 (thanks to @nikitug)
  * [BUGFIX] The usage of digits, hyphens and underscores in group names could lead to broken tab navigation
    in the default simplecov-html reports. See colszowka/simplecov-html#14 (thanks to @ebelgarts)
  * [REFACTORING] A few more ruby warnings removed. See colszowka/simplecov#106 and
    colszowka/simplecov#139. (thanks to @lukejahnke)
  * A [Pledgie button](colszowka/simplecov@63cfa99) for those that
    feel generous :)
  * The usual bunch of README fixes and documentation tweaks. Thanks to everyone who contributed those!
4ceab0f
@jsonn jsonn referenced this issue from a commit in jsonn/pkgsrc
taca Update ruby-simplecov.
Make this package to Ruby 1.9.3 only.

v0.7.1, 2012-10-12 ([changes](colszowka/simplecov@v0.7.0...v0.7.1))
-------------------

  * [BUGFIX] The gem packages of 0.7.0 (both simplecov and simplecov-html) pushed to Rubygems had some file
    permission issues, leading to problems when installing SimpleCov in a root/system Rubygems install and then
    trying to use it as a normal user (see colszowka/simplecov#171, thanks @envygeeks
    for bringing it up). The gem build process has been changed to always enforce proper permissions before packaging
    to avoid this issue in the future.


v0.7.0, 2012-10-10 ([changes](colszowka/simplecov@v0.6.4...v0.7.0))
-------------------

  * [FEATURE] The new `maximum_coverage_drop` and `minimum_coverage` now allow you to fail your build when the
    coverage dropped by more than what you allowed or is below a minimum value required. Also, `refuse_coverage_drop` disallows
    any coverage drops between test runs.
    See colszowka/simplecov#151, colszowka/simplecov#11,
    colszowka/simplecov#90, and colszowka/simplecov#96 (thanks to @infertux)
  * [FEATURE] SimpleCov now ships with a built-in MultiFormatter which allows the easy usage of multiple result formatters at
    the same time without the need to write custom wrapper code.
    See colszowka/simplecov#158 (thanks to @nikitug)
  * [BUGFIX] The usage of digits, hyphens and underscores in group names could lead to broken tab navigation
    in the default simplecov-html reports. See colszowka/simplecov-html#14 (thanks to @ebelgarts)
  * [REFACTORING] A few more ruby warnings removed. See colszowka/simplecov#106 and
    colszowka/simplecov#139. (thanks to @lukejahnke)
  * A [Pledgie button](colszowka/simplecov@63cfa99) for those that
    feel generous :)
  * The usual bunch of README fixes and documentation tweaks. Thanks to everyone who contributed those!
8758c51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.