[ARVADOS] created: 2.1.0-2375-g1dd56e127

Git user git at public.arvados.org
Mon Apr 25 21:03:52 UTC 2022


        at  1dd56e127c9460713f10996a5ff8d4ddf6244b29 (commit)


commit 1dd56e127c9460713f10996a5ff8d4ddf6244b29
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Mon Apr 25 17:00:53 2022 -0400

    18835: Add a test for the is_in_collection feature of PathMapper
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/.licenseignore b/.licenseignore
index d13eee390..387aeda94 100644
--- a/.licenseignore
+++ b/.licenseignore
@@ -51,6 +51,7 @@ docker/jobs/1078ECD7.key
 sdk/cwl/tests/input/blorp.txt
 sdk/cwl/tests/tool/blub.txt
 sdk/cwl/tests/federation/data/*
+sdk/cwl/tests/fake-keep-mount/fake_collection_dir/.arvados#collection
 sdk/go/manifest/testdata/*_manifest
 sdk/java/.classpath
 sdk/java/pom.xml
diff --git a/sdk/cwl/tests/fake-keep-mount/fake_collection_dir/.arvados#collection b/sdk/cwl/tests/fake-keep-mount/fake_collection_dir/.arvados#collection
new file mode 100644
index 000000000..fb13a7e37
--- /dev/null
+++ b/sdk/cwl/tests/fake-keep-mount/fake_collection_dir/.arvados#collection
@@ -0,0 +1,3 @@
+{
+  "portable_data_hash": "99999999999999999999999999999991+99"
+}
\ No newline at end of file
diff --git a/sdk/cwl/tests/fake-keep-mount/fake_collection_dir/subdir/banana.txt b/sdk/cwl/tests/fake-keep-mount/fake_collection_dir/subdir/banana.txt
new file mode 100644
index 000000000..05631af7b
--- /dev/null
+++ b/sdk/cwl/tests/fake-keep-mount/fake_collection_dir/subdir/banana.txt
@@ -0,0 +1,5 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+strawberry
diff --git a/sdk/cwl/tests/test_pathmapper.py b/sdk/cwl/tests/test_pathmapper.py
index cbd5ba1bc..194092db7 100644
--- a/sdk/cwl/tests/test_pathmapper.py
+++ b/sdk/cwl/tests/test_pathmapper.py
@@ -238,3 +238,16 @@ class TestPathmap(unittest.TestCase):
         p._pathmap["keep:99999999999999999999999999999991+99/hw.py"] = True
         p._pathmap["_:123"] = True
         self.assertTrue(p.needs_new_collection(a))
+
+    def test_is_in_collection(self):
+        arvrunner = arvados_cwl.executor.ArvCwlExecutor(self.api)
+        self.maxDiff = 1000000
+
+        cwd = os.getcwd()
+        p = ArvPathMapper(arvrunner, [{
+            "class": "File",
+            "location": "file://"+cwd+"/tests/fake-keep-mount/fake_collection_dir/subdir/banana.txt"
+        }], "", "/test/%s", "/test/%s/%s")
+
+        self.assertEqual({"file://"+cwd+"/tests/fake-keep-mount/fake_collection_dir/subdir/banana.txt": MapperEnt(resolved='keep:99999999999999999999999999999991+99/subdir/banana.txt', target='/test/99999999999999999999999999999991+99/subdir/banana.txt', type='File', staged=True)},
+                         p._pathmap)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list