Re: [PATCH] tests: switch to minitest

2014-05-12 Thread Ken Dreyer
On Sat, Apr 26, 2014 at 12:07 AM, Eric Wong e...@80x24.org wrote:
 Ken Dreyer ktdre...@ktdreyer.com wrote:
 Ruby 1.9+ uses Minitest as the backend for Test::Unit. As of Minitest 5,
 the shim has lost some backwards compatibility. It is time to make the
 jump to minitest.

 Adjust the unicorn test suite to support Minitest 5's syntax.

 Thank you very much for taking a look at this.  I was going to do it
 myself over the summer.

 I ran into some problems with our tests forking + minitest/autorun
 causing some problems due to at_exit usage.

Hi Eric,

Thanks very much for looking over my patch.

I've taken a look at yahns and the changes you made there, and I've
also been testing Unicorn here with my patch. I'm a bit confused about
your comments regarding the problems with forking and
minitest/autorun, because I'm not personally seeing test failures
regarding forking and my patch.

I am seeing one failure with the final assert in
TestSocketHelper#test_bind_listen_unix_rebind, but I don't think
that's a result of this, right?

Would you mind pointing me in the right direction?

- Ken
__
http://bogomips.org/unicorn-public/ - unicorn-pub...@bogomips.org
please quote as little as necessary when replying


Re: [PATCH] tests: switch to minitest

2014-05-12 Thread Eric Wong
Ken Dreyer ktdre...@ktdreyer.com wrote:
 I am seeing one failure with the final assert in
 TestSocketHelper#test_bind_listen_unix_rebind, but I don't think
 that's a result of this, right?

That's a new failure for me.  Sorry about the lack of info in my
original response :x

I'm failing on minitest 5.3.3, 4.7.5 seems fine, in fact.

Below the output of make -j8 test-unit V=1 on my machine (Ruby 2.1),
same failures on trunk, too (with minitest 5.3.3 installed)

: 
:   1) Failure:
: TestSocketHelper#test_bind_listen_unix_rebind 
[test/unit/test_socket_helper.rb:123]:
: Failed assertion, no message given.

snip

:   1) Failure:
: TestStreamInput#test_big_body_multi [test/unit/test_stream_input.rb:89]:
: Failed assertion, no message given.
: 
: 
:   2) Failure:
: TestStreamInput#test_gets_long [test/unit/test_stream_input.rb:110]:
: Failed assertion, no message given.
: 
make: *** [test/unit/test_stream_input.rb] Error 1

snip

:   1) Failure:
: TestTeeInput#test_gets_short [test/unit/test_tee_input.rb:69]:
: Failed assertion, no message given.
: 
: 
:   2) Failure:
: TestTeeInput#test_big_body_multi [test/unit/test_tee_input.rb:150]:
: Failed assertion, no message given.
: 
: 
:   3) Failure:
: TestTeeInput#test_chunked_ping_pong [test/unit/test_tee_input.rb:216]:
: Failed assertion, no message given.
: 
: 
:   4) Failure:
: TestTeeInput#test_chunked [test/unit/test_tee_input.rb:185]:
: Failed assertion, no message given.
: 
: 
:   5) Failure:
: TestTeeInput#test_chunked_with_trailer [test/unit/test_tee_input.rb:244]:
: Failed assertion, no message given.
: 
: 
:   6) Failure:
: TestTeeInput#test_gets_long [test/unit/test_tee_input.rb:50]:
: Failed assertion, no message given.
: 
: 
:   7) Failure:
: TestTeeInput#test_read_in_full_if_content_length 
[test/unit/test_tee_input.rb:123]:
: Failed assertion, no message given.
: 
: 12 runs, 57449 assertions, 7 failures, 0 errors, 0 skips
make: *** [test/unit/test_tee_input.rb] Error 1
__
http://bogomips.org/unicorn-public/ - unicorn-pub...@bogomips.org
please quote as little as necessary when replying


Re: [PATCH] tests: switch to minitest

2014-04-26 Thread Eric Wong
Ken Dreyer ktdre...@ktdreyer.com wrote:
 Ruby 1.9+ uses Minitest as the backend for Test::Unit. As of Minitest 5,
 the shim has lost some backwards compatibility. It is time to make the
 jump to minitest.
 
 Adjust the unicorn test suite to support Minitest 5's syntax.

Thank you very much for taking a look at this.  I was going to do it
myself over the summer.

I ran into some problems with our tests forking + minitest/autorun
causing some problems due to at_exit usage.

We probably need to workaround, I already did something for yahns
which we can reuse[1] in unicorn.

 Minitest versions 4 and below do not support the newer Minitest::Test
 class that arrived in version 5. For that case, use the
 MiniTest::Unit::TestCase class as a fallback.

For yahns, I did the following:
--- git://yhbt.net/yahns -- test/helper.rb --
gem 'minitest'
begin # favor minitest 5
  require 'minitest'
  Testcase = Minitest::Test
  mtobj = Minitest
rescue NameError, LoadError # but support minitest 4
  require 'minitest/unit'
  Testcase = Minitest::Unit::TestCase
  mtobj = MiniTest::Unit.new
end

# Not using minitest/autorun because that doesn't guard against redundant
# extra runs with fork.  We cannot use exit! in the tests either
# (since users/apps hosted on yahns _should_ expect exit, not exit!).
TSTART_PID = $$
at_exit do
  # skipping @@after_run stuff in minitest since we don't need it
  case $!
  when nil, SystemExit
exit(mtobj.run(ARGV)) if $$ == TSTART_PID
  end
end
 8 ---
I'd appreciate a second opinion on what I did with yahns above,
but it should work with unicorn.

Can you take a look at integrating+fixing those cases which fork?
Thanks again.

 Please keep me in the CC as I'm not subscribed to the unicorn email list.

No problem.  Also keeping unicorn-pub...@bogomips.org Cc-ed since that's
the new public-inbox[2] address and reply-all will be the norm there.
Hopefully public-inbox can encourage more drive-by contributors like
you :)


[1] - Fwiw, I give myself permission to relicense any yahns GPLv3+
  test code I wrote to (GPLv2+ || Ruby 1.8 license) for unicorn.
[2] - http://public-inbox.org/
___
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


Re: Re: [PATCH] tests: switch to minitest

2014-04-26 Thread Clara Anne
Eric

Where are you now. are you busy ? if u don't have any credit card to verify ur 
identity then u can create a free acc here, u dont need any cc or 
anything...just add ur email. I have profile here too but not often i use it. 
but for u i will login there today..
http://clara9024.meetupsecurely.com/ my user id : clara9024
go to my profile link and create a free acc..send a message there..i will reply 
after few minutes. 
thanks.
 
___
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying