15430: Updates wb1 test so that it exercises the ilike operator instead of @@
[arvados.git] / apps / workbench / test / test_helper.rb
index 6d8474edae1935981ecf7957030c795bbc4c78ad..84728b8c6882082bbaf015edf2dcb2450674d61f 100644 (file)
@@ -64,7 +64,7 @@ class ActiveSupport::TestCase
     # 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
@@ -348,3 +348,30 @@ 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