Test fixing wip
authorPeter Amstutz <peter.amstutz@curii.com>
Fri, 9 Sep 2022 14:30:37 +0000 (10:30 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Fri, 9 Sep 2022 14:30:37 +0000 (10:30 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/cwl/arvados_cwl/executor.py
sdk/cwl/tests/test_submit.py

index 34d50c1b6b6a5dccabda1b74af1c1b9c56d09058..5c74eb1f9855fa548a4b936b987c85b2ab9461a5 100644 (file)
@@ -520,7 +520,8 @@ The 'jobs' API is no longer supported.
             for req in job_reqs:
                 tool.requirements.append(req)
 
-    def get_git_info(self, tool):
+    @staticmethod
+    def get_git_info(tool):
         in_a_git_repo = False
         cwd = None
         filepath = None
index a726ec50179b25a94f81a27c4ab1e73226d3536b..59fa2af24696c106e6f6174bdc80fadbf0fb1e25 100644 (file)
@@ -19,6 +19,7 @@ import sys
 import unittest
 import cwltool.process
 import re
+import os
 
 from io import BytesIO
 
@@ -273,9 +274,17 @@ def stubs(wfname='submit_wf.cwl'):
             stubs.api.pipeline_instances().create().execute.return_value = stubs.pipeline_create
             stubs.api.pipeline_instances().get().execute.return_value = stubs.pipeline_with_job
 
-            with open("tests/wf/submit_wf_packed.cwl") as f:
+            cwd = os.getcwd()
+            filepath = os.path.join(cwd, "tests/wf/submit_wf_packed.cwl")
+            with open(filepath) as f:
                 expect_packed_workflow = yaml.round_trip_load(f)
 
+            expect_packed_workflow["id"] = "file://" + filepath
+            mocktool = mock.NonCallableMock(tool=expect_packed_workflow, metadata=expect_packed_workflow)
+
+            git_info = arvados_cwl.executor.ArvCwlExecutor.get_git_info(mocktool)
+            expect_packed_workflow.update(git_info)
+
             stubs.expect_container_spec = {
                 'priority': 500,
                 'mounts': {