[ARVADOS] updated: 5fd423a57ab1f34162f4cb2c08bd6b0b2515af40

git at public.curoverse.com git at public.curoverse.com
Wed Sep 24 11:41:53 EDT 2014


Summary of changes:
 services/api/test/test_helper.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

  discards  8e88f054ecbbcd8f92724dc69b85b88bd8569ab0 (commit)
       via  5fd423a57ab1f34162f4cb2c08bd6b0b2515af40 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (8e88f054ecbbcd8f92724dc69b85b88bd8569ab0)
            \
             N -- N -- N (5fd423a57ab1f34162f4cb2c08bd6b0b2515af40)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 5fd423a57ab1f34162f4cb2c08bd6b0b2515af40
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Sep 24 11:41:24 2014 -0400

    3889: Clean up counter checks. For now, warn instead of failing.

diff --git a/services/api/test/test_helper.rb b/services/api/test/test_helper.rb
index 23bd901..996d916 100644
--- a/services/api/test/test_helper.rb
+++ b/services/api/test/test_helper.rb
@@ -81,45 +81,28 @@ class ActiveSupport::TestCase
 end
 
 class ActionController::TestCase
-  def reset_counter
-    $counter = 0
+  setup do
+    @counter = 0
   end
 
   def check_counter action
-    $counter += 1
-    if $counter > 1
-      raise "Too many actions on a single instance of ActionController::TestCase #{action}"
+    @counter += 1
+    if @counter == 2
+      # TODO: when existing mistakes are fixed, start failing broken
+      # test cases like this:
+      #
+      # assert_equal 1, 2, "Multiple actions in functional test"
+      #
+      # Meanwhile, just warn (just once per test case):
+      $stderr.puts " [WARNING: Multiple actions in functional test]"
     end
   end
 
-  alias original_run_callbacks run_callbacks
-  def run_callbacks(kind, &block)
-    reset_counter
-    original_run_callbacks(kind, &block)
-  end
-
-  alias original_get get
-  def get(action, *args)
-    check_counter action
-    original_get(action, *args)
-  end
-
-  alias original_post post
-  def post(action, *args)
-    check_counter action
-    original_post(action, *args)
-  end
-
-  alias original_put put
-  def put(action, *args)
-    check_counter action
-    original_put(action, *args)
-  end
-
-  alias original_delete delete
-  def delete(action, *args)
-    check_counter action
-    original_delete(action, *args)
+  [:get, :post, :put, :patch, :delete].each do |method|
+    define_method method do |action, *args|
+      check_counter action
+      super action, *args
+    end
   end
 end
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list