From 63cc3ee529250a6b09dd7e032dc73ec509000c0f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 16 Jan 2015 03:09:09 +0000 Subject: tests: create fresh intances for all integration tests This should make it easier to fully test on machines without access to an existing MogileFS instance. You'll still need mogilefsd and mogstored available, however, but these tests are skipped on machines without them. --- test/integration.rb | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 test/integration.rb (limited to 'test/integration.rb') diff --git a/test/integration.rb b/test/integration.rb deleted file mode 100644 index a0c876b..0000000 --- a/test/integration.rb +++ /dev/null @@ -1,43 +0,0 @@ -# -*- encoding: binary -*- -require './test/exec' - -class TestMogIntegration < Test::Unit::TestCase - include TestExec - - def test_dummy - assert true, "Ruby 1.8 Test::Unit is broken" - end unless defined?(MiniTest) - - def setup - @to_close = [] - @trackers = ENV["MOG_TEST_TRACKERS"].split(/,/) - domain = "rbmogtest#{Time.now.strftime('%Y%m%d%H%M%S')}.#{uuid}" - @admin = MogileFS::Admin.new(:hosts => @trackers) - @admin.create_domain(domain) - yield_for_monitor_update do - @admin.get_domains.include?(domain) and break - end - @domain = domain - end - - def teardown - if defined?(@domain) - client = MogileFS::MogileFS.new :hosts => @trackers, :domain => @domain - client.each_key("") { |key| - p [ :delete, key ] if $VERBOSE - client.delete(key) - } - assert_equal true, @admin.delete_domain(@domain) - assert_raises(MogileFS::Backend::DomainNotFoundError) do - @admin.delete_domain(@domain) - end - end - @to_close.each do |io| - io.closed? or io.close - end - end -end if ENV["MOG_TEST_TRACKERS"] - -class TestMogIntegration - warn "MOG_TEST_TRACKERS not defined" -end unless ENV["MOG_TEST_TRACKERS"] -- cgit v1.2.3-24-ge0c7