Project

General

Profile

Actions

Bug #4153

closed

Minitest or ruby bug - wrong return code

Added by rupert (Robert Pankowecki) over 14 years ago. Updated about 14 years ago.

Status:
Rejected
Target version:
-
ruby -v:
ruby 1.9.2dev (2010-08-02 revision 28830) [i686-linux]
Backport:
[ruby-core:33690]

Description

=begin
It all started here: https://github.com/jnicklas/capybara/issues/#issue/178
It seems that there is a bug in minitest which leads to returning wrong error code by the script (0 instead of 1) when errors occurs.

You can find examples of scripts that exits with the wrong code at:
https://github.com/jnicklas/capybara/issues/#issue/178/comment/604897
https://github.com/jnicklas/capybara/issues/#issue/178/comment/605003

Robert Pankowecki
=end

Actions #1

Updated by zenspider (Ryan Davis) over 14 years ago

  • Category set to lib
  • Assignee set to zenspider (Ryan Davis)

=begin
I hesitate to say that this is a bug at all. It is just the way that ruby works w/ at_exit. They queue up and if someone exits inside, last exit code wins. I'm not sure what a good fix is for this. It is best reduced to:

require 'rubygems'
require 'minitest/autorun'

class TestExitBug < MiniTest::Unit::TestCase
def test_exit_bug
at_exit { exit 0 }

 flunk

end
end

% ruby x.rb; echo $?

Run options: --seed 60555

# Running tests:

F

Finished tests in 0.000515s, 1941.7476 tests/s, 1941.7476 assertions/s.

1) Failure:

test_exit_bug(TestExitBug) [x.rb:8]:

Epic Fail!

1 tests, 1 assertions, 1 failures, 0 errors, 0 skips

0

=end

Actions #2

Updated by zenspider (Ryan Davis) over 14 years ago

=begin
I was mistaken. They stack, not queue. I have a tentative solution for this that I'm testing.
=end

Actions #3

Updated by naruse (Yui NARUSE) over 14 years ago

=begin
What's current status?
If this is resolved, please close this.
=end

Actions #4

Updated by zenspider (Ryan Davis) over 14 years ago

  • Status changed from Open to Rejected

=begin

=end

Actions #5

Updated by zenspider (Ryan Davis) over 14 years ago

=begin

On Dec 25, 2010, at 21:44 , Yui NARUSE wrote:

Issue #4153 has been updated by Yui NARUSE.

What's current status?
If this is resolved, please close this.

The current status is that this is really a bug in their code, but I'll be damned if I can convince them of this. I've added a workaround to minitest to deal with it, but they're off hassling all the other test framework authors instead of fixing their actual issue. I can close this ticket.

=end

Actions #6

Updated by zenspider (Ryan Davis) over 14 years ago

=begin

On Dec 25, 2010, at 21:44 , Yui NARUSE wrote:

Issue #4153 has been updated by Yui NARUSE.

What's current status?
If this is resolved, please close this.

I should add... This is fixed on trunk, but still needs to be merged to 1_9_2. I filed a ticket before the release but 1.9.2p136 still ships with minitest 1.6.0 (approx march 2010). Is there anything I can do to help there?

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0