[ARVADOS] updated: 1.3.0-711-g810fc3e7a

Git user git at public.curoverse.com
Wed Apr 10 20:31:41 UTC 2019


Summary of changes:
 sdk/cwl/tests/test_make_output.py | 91 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

       via  810fc3e7aab72aa5ae951141955b56f6d4e47cfd (commit)
      from  2f2d82b01df5f9175cd94518e8574e58461cd93f (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 810fc3e7aab72aa5ae951141955b56f6d4e47cfd
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Wed Apr 10 16:31:26 2019 -0400

    14723: Adds tests for multiple file targets and literal name resolution
    
    Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti at veritasgenetics.com>

diff --git a/sdk/cwl/tests/test_make_output.py b/sdk/cwl/tests/test_make_output.py
index 562d1765d..9002bb1df 100644
--- a/sdk/cwl/tests/test_make_output.py
+++ b/sdk/cwl/tests/test_make_output.py
@@ -81,3 +81,94 @@ class TestMakeOutput(unittest.TestCase):
         self.api.links().create.assert_has_calls([mock.call(body={"head_uuid": final_uuid, "link_class": "tag", "name": "tag0"}), mock.call().execute(num_retries=num_retries)])
         self.api.links().create.assert_has_calls([mock.call(body={"head_uuid": final_uuid, "link_class": "tag", "name": "tag1"}), mock.call().execute(num_retries=num_retries)])
         self.api.links().create.assert_has_calls([mock.call(body={"head_uuid": final_uuid, "link_class": "tag", "name": "tag2"}), mock.call().execute(num_retries=num_retries)])
+
+    @mock.patch("arvados.collection.Collection")
+    @mock.patch("arvados.collection.CollectionReader")
+    def test_make_output_for_multiple_file_targets(self, reader, col):
+        keep_client = mock.MagicMock()
+        runner = arvados_cwl.executor.ArvCwlExecutor(self.api, keep_client=keep_client)
+        runner.project_uuid = 'zzzzz-j7d0g-zzzzzzzzzzzzzzz'
+
+        final = mock.MagicMock()
+        col.return_value = final
+        readermock = mock.MagicMock()
+        reader.return_value = readermock
+
+        # This output describes a single file listed in 2 different directories
+        _, runner.final_output_collection = runner.make_output_collection("Test output", ["foo"], "", { 'out': [
+        {
+            'basename': 'testdir1', 
+            'listing': [
+                { 
+                    'basename': 'test.txt', 
+                    'nameroot': 'test', 
+                    'nameext': '.txt', 
+                    'location': 'keep:99999999999999999999999999999991+99/test.txt', 
+                    'class': 'File', 
+                    'size': 16
+                }
+            ], 
+            'location': '_:99999999999999999999999999999992+99',
+            'class': 'Directory'
+        }, 
+        {
+            'basename': 'testdir2', 
+            'listing': [
+                {
+                    'basename': 'test.txt', 
+                    'nameroot': 'test', 
+                    'nameext': '.txt', 
+                    'location': 'keep:99999999999999999999999999999991+99/test.txt', 
+                    'class': 
+                    'File', 
+                    'size': 16
+                }
+            ], 
+            'location': '_:99999999999999999999999999999993+99',
+            'class': 'Directory'
+        }]})
+
+        # Check that copy is called on the collection for both locations
+        final.copy.assert_any_call("test.txt", "testdir1/test.txt", source_collection=mock.ANY, overwrite=mock.ANY)
+        final.copy.assert_any_call("test.txt", "testdir2/test.txt", source_collection=mock.ANY, overwrite=mock.ANY)
+
+    @mock.patch("arvados.collection.Collection")
+    @mock.patch("arvados.collection.CollectionReader")
+    def test_make_output_for_literal_name_conflicts(self, reader, col):
+        keep_client = mock.MagicMock()
+        runner = arvados_cwl.executor.ArvCwlExecutor(self.api, keep_client=keep_client)
+        runner.project_uuid = 'zzzzz-j7d0g-zzzzzzzzzzzzzzz'
+
+        final = mock.MagicMock()
+        col.return_value = final
+        readermock = mock.MagicMock()
+        reader.return_value = readermock
+
+        # This output describes two literals with the same basename
+        _, runner.final_output_collection = runner.make_output_collection("Test output", ["foo"], "",  [
+        { 
+            'lit': 
+            {
+                'basename': 'a_file', 
+                'nameext': '', 
+                'nameroot': 'a_file', 
+                'location': '_:f168fc0c-4291-40aa-a04e-366d57390560', 
+                'class': 'File', 
+                'contents': 'Hello file literal.'
+            }
+        },
+        {
+            'lit': 
+            {
+                'basename': 'a_file', 
+                'nameext': '', 
+                'nameroot': 'a_file', 
+                'location': '_:1728da8f-c64e-4a3e-b2e2-1ee356be7bc8', 
+                'class': 'File', 
+                'contents': 'Hello file literal.'
+            }
+        }])
+
+        # Check that the file name conflict is resolved and open is called for both
+        final.open.assert_any_call("a_file", "wb")
+        final.open.assert_any_call("a_file_2", "wb")
\ No newline at end of file

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list