[ARVADOS] updated: 446868283108deda5510f4419b4065d254a4c5a8
git at public.curoverse.com
git at public.curoverse.com
Mon Aug 17 10:59:31 EDT 2015
Summary of changes:
services/api/test/unit/salvage_collection_test.rb | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
via 446868283108deda5510f4419b4065d254a4c5a8 (commit)
from 3987bcc3f5f6acf9207e94049561c632b454f38a (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 446868283108deda5510f4419b4065d254a4c5a8
Author: radhika <radhika at curoverse.com>
Date: Mon Aug 17 10:58:48 2015 -0400
6859: add one more test with error during arv-put
diff --git a/services/api/test/unit/salvage_collection_test.rb b/services/api/test/unit/salvage_collection_test.rb
index 4cc5378..09ab6cf 100644
--- a/services/api/test/unit/salvage_collection_test.rb
+++ b/services/api/test/unit/salvage_collection_test.rb
@@ -6,9 +6,16 @@ TEST_MANIFEST = ". 341dabea2bd78ad0d6fc3f5b926b450e+85626+Ad391622a17f61e4a254ed
module Kernel
def `(cmd) # override kernel ` method
if cmd.include? 'arv-put'
- ". " +
- Digest::MD5.hexdigest(TEST_MANIFEST) +
- " 0:" + TEST_MANIFEST.length.to_s + ":invalid_manifest_text.txt\n"
+ file_contents = file = File.new(cmd.split[-1], "r").gets
+
+ # simulate arv-put error when it is 'user_agreement'
+ if file_contents.include? 'GNU_General_Public_License'
+ return ''
+ else
+ ". " +
+ Digest::MD5.hexdigest(TEST_MANIFEST) +
+ " 0:" + TEST_MANIFEST.length.to_s + ":invalid_manifest_text.txt\n"
+ end
end
end
@@ -79,4 +86,10 @@ class SalvageCollectionTest < ActiveSupport::TestCase
end
assert_equal true, exited
end
+
+ test "salvage collection with during arv-put" do
+ # try to salvage collection while mimicking error during arv-put
+ status = SalvageCollection.salvage_collection collections('user_agreement').uuid
+ assert_equal false, status
+ end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list