From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 659571F461; Fri, 29 Dec 2023 17:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yhbt.net; s=selector1; t=1703872245; bh=E/dOqsTiU8g8Wz1+XRulLw8JrP8sG3MFLPYQH5xMFhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=THRjCjrC/KdHTZ1htJexTgP8Vv9BVFDKGByKUdotERjeyil4V1Jwsa+LNcGnKoj5W +/Wi9CdnOgaoAnVSiYZfODRe3E3ha1y2UwfCCpVzvDY3NA4+b1W1/XW6NsxOm4ug/u wiFl9gTgQcnv4aZF5B3notoIC2/i0nrdfb73VHCE= From: Eric Wong To: raindrops-public@yhbt.net Cc: Eric Wong Subject: [PATCH 1/4] tests: support running tests without rack||aggregate Date: Fri, 29 Dec 2023 17:50:18 +0000 Message-ID: <20231229175021.17727-2-bofh@yhbt.net> In-Reply-To: <20231229175021.17727-1-bofh@yhbt.net> References: <20231229175021.17727-1-bofh@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: From: Eric Wong Diskspace and bandwidth are expensive, and we can make rack+aggregate optional in tests, too. --- test/rack_unicorn.rb | 3 +-- test/test_last_data_recv.rb | 8 +++++++- test/test_watcher.rb | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/test/rack_unicorn.rb b/test/rack_unicorn.rb index 779e8bf..0ecbd42 100644 --- a/test/rack_unicorn.rb +++ b/test/rack_unicorn.rb @@ -1,11 +1,10 @@ # -*- encoding: binary -*- require "test/unit" require "raindrops" -require "rack" -require "rack/lobster" require "open-uri" begin require "unicorn" + require "rack" require "rack/lobster" rescue LoadError => e warn "W: #{e} skipping test since Rack or Unicorn was not found" diff --git a/test/test_last_data_recv.rb b/test/test_last_data_recv.rb index ef84e05..b1a5ac6 100644 --- a/test/test_last_data_recv.rb +++ b/test/test_last_data_recv.rb @@ -1,3 +1,9 @@ +begin + require 'aggregate' + have_aggregate = true +rescue LoadError => e + warn "W: #{e} skipping #{__FILE__}" +end require 'test/unit' require 'raindrops' require 'io/wait' @@ -40,4 +46,4 @@ def test_accept_nonblock_one assert_equal 1, s.raindrops_aggregate.size assert_raise(IO::WaitReadable) { s.accept_nonblock } end -end if RUBY_PLATFORM =~ /linux/ +end if RUBY_PLATFORM =~ /linux/ && have_aggregate diff --git a/test/test_watcher.rb b/test/test_watcher.rb index 28ac49b..e5d1fa2 100644 --- a/test/test_watcher.rb +++ b/test/test_watcher.rb @@ -1,9 +1,9 @@ # -*- encoding: binary -*- require "test/unit" -require "rack" require "raindrops" begin require 'aggregate' + require 'rack' rescue LoadError => e warn "W: #{e} skipping #{__FILE__}" end @@ -183,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/ && defined?(Aggregate) +end if RUBY_PLATFORM =~ /linux/ && defined?(Aggregate) && defined?(Rack)