# Restore configuration settings changed during tests
ConfigLoader.copy_into_config $arvados_config, Rails.configuration
ConfigLoader.copy_into_config $remaining_config, Rails.configuration
- Rails.configuration.Services.Controller.ExternalURL = "https://#{ENV['ARVADOS_API_HOST']}"
+ Rails.configuration.Services.Controller.ExternalURL = URI("https://#{ENV['ARVADOS_API_HOST']}")
Rails.configuration.TLS.Insecure = true
end
end
# Reset fixtures now (i.e., before any tests run).
ActiveSupport::TestCase.reset_api_fixtures_now
+
+module Minitest
+ class Test
+ def capture_exceptions *args
+ begin
+ n = 0
+ begin
+ yield
+ rescue *PASSTHROUGH_EXCEPTIONS
+ raise
+ rescue Exception => e
+ n += 1
+ raise if n > 2 || e.is_a?(Skip)
+ STDERR.puts "Test failed, retrying (##{n})"
+ ActiveSupport::TestCase.reset_api_fixtures_now
+ retry
+ end
+ rescue *PASSTHROUGH_EXCEPTIONS
+ raise
+ rescue Assertion => e
+ self.failures << e
+ rescue Exception => e
+ self.failures << UnexpectedError.new(e)
+ end
+ end
+ end
+end