[ARVADOS] updated: d6c2c9f1446c35a23f7dc1f73de398c4484e0cbe

git at public.curoverse.com git at public.curoverse.com
Wed Jun 17 22:06:32 EDT 2015


Summary of changes:
 .../controllers/collections_controller_test.rb     | 30 +++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

       via  d6c2c9f1446c35a23f7dc1f73de398c4484e0cbe (commit)
      from  ad1f68c37d46e56916e18996e14405ed9dab7d35 (commit)

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 d6c2c9f1446c35a23f7dc1f73de398c4484e0cbe
Author: radhika <radhika at curoverse.com>
Date:   Wed Jun 17 22:04:10 2015 -0400

    6277: since locators are added to multilevel_collection_1 fixture, the collection retrieved after an update will have
    a signed manifest; hence, the test needs to compare the old manifest with the new one after stripping signatures.

diff --git a/apps/workbench/test/controllers/collections_controller_test.rb b/apps/workbench/test/controllers/collections_controller_test.rb
index dc1e4d5..b99ab95 100644
--- a/apps/workbench/test/controllers/collections_controller_test.rb
+++ b/apps/workbench/test/controllers/collections_controller_test.rb
@@ -402,15 +402,39 @@ class CollectionsControllerTest < ActionController::TestCase
     assert_not_nil assigns(:object)
     # Ensure the Workbench response still has the original manifest_text
     assert_equal 'test description update', assigns(:object).description
-    assert_equal collection['manifest_text'], assigns(:object).manifest_text
+    assert_equal true, strip_signatures_and_compare(collection['manifest_text'], assigns(:object).manifest_text)
     # Ensure the API server still has the original manifest_text after
     # we called arvados.v1.collections.update
     use_token :active do
-      assert_equal(Collection.find(collection['uuid']).manifest_text,
-                   collection['manifest_text'])
+      assert_equal true, strip_signatures_and_compare(Collection.find(collection['uuid']).manifest_text,
+                                                      collection['manifest_text'])
     end
   end
 
+  # Since we got the initial collection from fixture, there are no signatures in manifest_text.
+  # However, after update or find, the collection retrieved will have singed manifest_text.
+  # Hence, let's compare each line after excluding signatures.
+  def strip_signatures_and_compare m1, m2
+    m1_lines = m1.split "\n"
+    m2_lines = m2.split "\n"
+
+    return false if m1_lines.size != m2_lines.size
+
+    m1_lines.each_with_index do |line, i|
+      m1_words = []
+      line.split.each do |word|
+        m1_words << word.split('+A')[0]
+      end
+      m2_words = []
+      m2_lines[i].split.each do |word|
+        m2_words << word.split('+A')[0]
+      end
+      return false if !m1_words.join(' ').eql?(m2_words.join(' '))
+    end
+
+    return true
+  end
+
   test "view collection and verify none of the file types listed are disabled" do
     show_collection(:collection_with_several_supported_file_types, :active)
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list