From: Eric Wong <e@80x24.org>
To: spew@80x24.org
Subject: [PATCH] test_watcher: disable test correctly when aggregate is missing
Date: Wed, 15 Mar 2017 23:39:46 +0000 [thread overview]
Message-ID: <20170315233946.3371-1-e@80x24.org> (raw)
Oops :x
---
test/test_aggregate_pmq.rb | 2 +-
test/test_last_data_recv_unicorn.rb | 2 +-
test/test_watcher.rb | 7 ++++++-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/test/test_aggregate_pmq.rb b/test/test_aggregate_pmq.rb
index 7748b4f..692b9bd 100644
--- a/test/test_aggregate_pmq.rb
+++ b/test/test_aggregate_pmq.rb
@@ -3,7 +3,7 @@
pmq = begin
Raindrops::Aggregate::PMQ
rescue LoadError => e
- warn "W: #{e} skipping test"
+ warn "W: #{e} skipping #{__FILE__}"
false
end
if RUBY_VERSION.to_f < 1.9
diff --git a/test/test_last_data_recv_unicorn.rb b/test/test_last_data_recv_unicorn.rb
index ca48715..60d1be9 100644
--- a/test/test_last_data_recv_unicorn.rb
+++ b/test/test_last_data_recv_unicorn.rb
@@ -7,7 +7,7 @@
pmq = begin
Raindrops::Aggregate::PMQ
rescue LoadError => e
- warn "W: #{e} skipping test"
+ warn "W: #{e} skipping #{__FILE__}"
false
end
if RUBY_VERSION.to_f < 1.9
diff --git a/test/test_watcher.rb b/test/test_watcher.rb
index 70e8e75..d1e4d15 100644
--- a/test/test_watcher.rb
+++ b/test/test_watcher.rb
@@ -2,6 +2,11 @@
require "test/unit"
require "rack"
require "raindrops"
+begin
+ require 'aggregate'
+rescue LoadError => e
+ warn "W: #{e} skipping #{__FILE__}"
+end
class TestWatcher < Test::Unit::TestCase
TEST_ADDR = ENV['UNICORN_TEST_ADDR'] || '127.0.0.1'
@@ -178,4 +183,4 @@ def test_peaks
assert_equal queued_before, headers["X-Last-Peak-At"], "should not change"
assert_equal start, headers["X-First-Peak-At"]
end
-end if RUBY_PLATFORM =~ /linux/
+end if RUBY_PLATFORM =~ /linux/ && defined?(Aggregate)
--
EW
reply other threads:[~2017-03-15 23:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170315233946.3371-1-e@80x24.org \
--to=e@80x24.org \
--cc=spew@80x24.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.
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).