From: Eric Wong <e@80x24.org>
To: Ken Dreyer <ktdreyer@ktdreyer.com>
Cc: unicorn-public@bogomips.org, mongrel-unicorn@rubyforge.org
Subject: Re: [PATCH] tests: switch to minitest
Date: Sat, 26 Apr 2014 06:07:44 +0000 [thread overview]
Message-ID: <20140426060744.GA17493@dcvr.yhbt.net> (raw)
In-Reply-To: <1398482426-3245-1-git-send-email-ktdreyer@ktdreyer.com>
Ken Dreyer <ktdreyer@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-public@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/
next prev parent reply other threads:[~2014-04-26 6:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-26 3:20 [PATCH] tests: switch to minitest Ken Dreyer
2014-04-26 6:07 ` Eric Wong [this message]
2014-05-13 0:46 ` Ken Dreyer
2014-05-13 1:13 ` Eric Wong
2014-05-29 19:17 ` Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/unicorn/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140426060744.GA17493@dcvr.yhbt.net \
--to=e@80x24.org \
--cc=ktdreyer@ktdreyer.com \
--cc=mongrel-unicorn@rubyforge.org \
--cc=unicorn-public@bogomips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/unicorn.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).