Bug #4153
closedMinitest or ruby bug - wrong return code
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
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
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
Updated by naruse (Yui NARUSE) over 14 years ago
=begin
What's current status?
If this is resolved, please close this.
=end
Updated by zenspider (Ryan Davis) over 14 years ago
- Status changed from Open to Rejected
=begin
=end
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
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