From 28aab06e493363b143476d44ec3d39e8403cd28e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 24 Dec 2008 00:13:48 -0800 Subject: [PATCH] test_mogilefs: allow NR_CHUNKS to be overridable via env This way tests can run quicker by default but we can still use larger ones to test things. --- test/test_mogilefs.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/test_mogilefs.rb b/test/test_mogilefs.rb index b884fda..e8e96c6 100644 --- a/test/test_mogilefs.rb +++ b/test/test_mogilefs.rb @@ -46,7 +46,7 @@ class TestMogileFS__MogileFS < TestMogileFS def test_get_file_data_http_block tmpfp = Tempfile.new('test_mogilefs.open_data') - nr = 100 # tested with 1000 + nr = nr_chunks chunk_size = 1024 * 1024 expect_size = nr * chunk_size header = "HTTP/1.0 200 OK\r\n" \ @@ -337,7 +337,7 @@ class TestMogileFS__MogileFS < TestMogileFS to_put = Tempfile.new('test_mogilefs.to_put') received = Tempfile.new('test_mogilefs.received') - nr = 10 # tested with 1000 + nr = nr_chunks chunk_size = 1024 * 1024 expect_size = nr * chunk_size @@ -442,5 +442,12 @@ class TestMogileFS__MogileFS < TestMogileFS end end + private + + # tested with 1000, though it takes a while + def nr_chunks + ENV['NR_CHUNKS'] ? ENV['NR_CHUNKS'].to_i : 10 + end + end -- 2.11.4.GIT