[arvados] updated: 2.1.0-3210-gea0eb0ed7

git repository hosting git at public.arvados.org
Fri Dec 16 15:26:21 UTC 2022


Summary of changes:
 sdk/cwl/tests/test_copy_deps.py | 58 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 54 insertions(+), 4 deletions(-)

       via  ea0eb0ed7ffe2f14c2539ea1baa9251e06cc0e75 (commit)
      from  9b0de8314d6297df506734844bb2b833ba7d022c (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 ea0eb0ed7ffe2f14c2539ea1baa9251e06cc0e75
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Dec 16 10:25:20 2022 -0500

    Test needs to ignore varying "acrContainerImage" field
    
    refs #19688
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/sdk/cwl/tests/test_copy_deps.py b/sdk/cwl/tests/test_copy_deps.py
index 1d8cc1219..54d90580f 100644
--- a/sdk/cwl/tests/test_copy_deps.py
+++ b/sdk/cwl/tests/test_copy_deps.py
@@ -3,10 +3,60 @@
 # SPDX-License-Identifier: Apache-2.0
 
 import arvados
+import arvados.collection
 import subprocess
+import json
 
 api = arvados.api()
 
+workflow_content = """{
+    "$graph": [
+        {
+            "baseCommand": "echo",
+            "class": "CommandLineTool",
+            "cwlVersion": "v1.2",
+            "hints": [
+                {
+                    "class": "http://arvados.org/cwl#WorkflowRunnerResources"
+                }
+            ],
+            "id": "#main",
+            "inputs": [
+                {
+                    "default": {
+                        "basename": "b",
+                        "class": "File",
+                        "location": "keep:d7514270f356df848477718d58308cc4+94/b",
+                        "nameext": "",
+                        "nameroot": "b",
+                        "size": 0
+                    },
+                    "id": "#main/message",
+                    "inputBinding": {
+                        "position": 1
+                    },
+                    "type": "File"
+                }
+            ],
+            "outputs": []
+        }
+    ],
+    "cwlVersion": "v1.2"
+}"""
+
+def check_workflow_content(uuid):
+    c = arvados.collection.Collection(uuid)
+    try:
+        j = json.load(c.open("workflow.json"))
+    except IOError:
+        return False
+    # The value of "acrContainerImage" is tied to the specific version
+    # of arvados-cwl-runner so we can't just compare PDH of the whole
+    # workflow collection, it changes with every version.
+    del j["$graph"][0]["hints"][0]["acrContainerImage"]
+    print
+    return json.dumps(j, sort_keys=True, indent=4, separators=(',',': ')) == workflow_content
+
 def check_contents(group, wf_uuid):
     contents = api.groups().contents(uuid=group["uuid"]).execute()
     if len(contents["items"]) != 4:
@@ -35,10 +85,10 @@ def check_contents(group, wf_uuid):
 
     found = False
     for c in contents["items"]:
-        if c["kind"] == "arvados#collection" and c["portable_data_hash"] == "73b7a68c78205e793a5eb9520326d3ae+61":
+        if c["kind"] == "arvados#collection" and check_workflow_content(c["portable_data_hash"]):
             found = True
     if not found:
-        raise Exception("Couldn't find collection containing workflow")
+        raise Exception("Couldn't find collection containing expected workflow.json")
 
 
 def test_create():
@@ -84,10 +134,10 @@ def test_update():
 
         found = False
         for c in contents["items"]:
-            if c["kind"] == "arvados#collection" and c["portable_data_hash"] == "73b7a68c78205e793a5eb9520326d3ae+61":
+            if c["kind"] == "arvados#collection" and check_workflow_content(c["portable_data_hash"]):
                 found = True
         if not found:
-            raise Exception("Couldn't find collection containing workflow")
+            raise Exception("Couldn't find collection containing expected workflow.json")
 
         # Updating by default will copy missing items
         cmd = ["arvados-cwl-runner", "--disable-git", "--update-workflow", wf_uuid, "19070-copy-deps.cwl"]

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list