Skip to content

Guard/Spork error in Simplecov 0.8.1 and up #262

@jordanrs

Description

@jordanrs

The following issue seems to have been introduced for me in the changes to the at_exit block in PR #213. Previously the old code would assign @exit_status to nil if neither SimpleCov::ExitCodes::MINIMUM_COVERAGE or SimpleCov::ExitCodes::MAXIMUM_COVERAGE_DROP were set. This meant that the exit call at the bottom would not be called.

Now since @exit_status is always set it will always call exit which is causing the below exception when run using guard/spork. No errors are thrown when run normally from the console

Im not sure wether this is a simplecov issue or one of the other gems but should simplecov call exit! instead at the end to terminate the process immediately or not call exit again if the status hasn't changed from the one passed in so the at_exit continues on with the original code.

A quick test locally of calling exit! prevents the error in guard/spork and still leaves all the tests passing, im just not sure if this would have any implications on other gems so iv put it out there for some smarter minds to weigh in on..

Gems
spork (1.0.0rc3)
guard-rspec (= 2.5.0)
guard-spork (= 1.5.0)
guard (2.2.3)
rspec (2.14.1)

Exception encountered: #<SystemExit: exit>
backtrace:
/Users/jordan/.rvm/gems/ruby-2.0.0-p247@app/gems/simplecov-0.8.1/lib/simplecov/defaults.rb:80:in `exit'
/Users/jordan/.rvm/gems/ruby-2.0.0-p247@app/gems/simplecov-0.8.1/lib/simplecov/defaults.rb:80:in `block in <top (required)>'
/Users/jordan/.rvm/gems/ruby-2.0.0-p247@app/gems/spork-1.0.0rc3/lib/spork.rb:77:in `call'
/Users/jordan/.rvm/gems/ruby-2.0.0-p247@app/gems/spork-1.0.0rc3/lib/spork.rb:77:in `exec_after_each_run'
/Users/jordan/.rvm/gems/ruby-2.0.0-p247@app/gems/spork-1.0.0rc3/lib/spork/run_strategy/forking.rb:14:in `block in run'
/Users/jordan/.rvm/gems/ruby-2.0.0-p247@app/gems/spork-1.0.0rc3/lib/spork/forker.rb:21:in `block in initialize'
/Users/jordan/.rvm/gems/ruby-2.0.0-p247@app/gems/spork-1.0.0rc3/lib/spork/forker.rb:18:in `fork'
/Users/jordan/.rvm/gems/ruby-2.0.0-p247@app/gems/spork-1.0.0rc3/lib/spork/forker.rb:18:in `initialize'
/Users/jordan/.rvm/gems/ruby-2.0.0-p247@app/gems/spork-1.0.0rc3/lib/spork/run_strategy/forking.rb:9:in `new'
/Users/jordan/.rvm/gems/ruby-2.0.0-p247@app/gems/spork-1.0.0rc3/lib/spork/run_strategy/forking.rb:9:in `run'
/Users/jordan/.rvm/gems/ruby-2.0.0-p247@app/gems/spork-1.0.0rc3/lib/spork/server.rb:48:in `run'
/Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/drb/drb.rb:1588:in `perform_without_block'
/Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/drb/drb.rb:1548:in `perform'
/Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/drb/drb.rb:1626:in `block (2 levels) in main_loop'
/Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/drb/drb.rb:1622:in `loop'
/Users/jordan/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/drb/drb.rb:1622:in `block in main_loop'
Done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions