X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9828e9218084856240fdeafa2d388d8bf322e655..09cbdc3074b3f1e69c9c537875146f6da0a6ed8f:/sdk/cwl/tests/test_container.py diff --git a/sdk/cwl/tests/test_container.py b/sdk/cwl/tests/test_container.py index 53a94eb455..75371e2b78 100644 --- a/sdk/cwl/tests/test_container.py +++ b/sdk/cwl/tests/test_container.py @@ -186,7 +186,7 @@ class TestContainer(unittest.TestCase): 'command': ['ls', '/var/spool/cwl'], 'cwd': '/var/spool/cwl', 'scheduling_parameters': {}, - 'properties': {}, + 'properties': {'cwl_input': {}}, 'secret_mounts': {}, 'output_storage_classes': ["default"] })) @@ -278,7 +278,7 @@ class TestContainer(unittest.TestCase): 'scheduling_parameters': { 'partitions': ['blurb'] }, - 'properties': {}, + 'properties': {'cwl_input': {}}, 'secret_mounts': {}, 'output_storage_classes': ["default"] } @@ -411,7 +411,7 @@ class TestContainer(unittest.TestCase): 'cwd': '/var/spool/cwl', 'scheduling_parameters': { }, - 'properties': {}, + 'properties': {'cwl_input': {}}, 'secret_mounts': {}, 'output_storage_classes': ["default"] } @@ -498,7 +498,7 @@ class TestContainer(unittest.TestCase): 'command': ['ls', '/var/spool/cwl'], 'cwd': '/var/spool/cwl', 'scheduling_parameters': {}, - 'properties': {}, + 'properties': {'cwl_input': {}}, 'secret_mounts': {}, 'output_storage_classes': ["default"] })) @@ -535,6 +535,7 @@ class TestContainer(unittest.TestCase): arvjob.successCodes = [0] arvjob.outdir = "/var/spool/cwl" arvjob.output_ttl = 3600 + arvjob.uuid = "zzzzz-xvhdp-zzzzzzzzzzzzzz1" arvjob.collect_outputs.return_value = {"out": "stuff"} @@ -544,7 +545,8 @@ class TestContainer(unittest.TestCase): "output_uuid": "zzzzz-4zz18-zzzzzzzzzzzzzz2", "uuid": "zzzzz-xvhdp-zzzzzzzzzzzzzzz", "container_uuid": "zzzzz-8i9sb-zzzzzzzzzzzzzzz", - "modified_at": "2017-05-26T12:01:22Z" + "modified_at": "2017-05-26T12:01:22Z", + "properties": {} }) self.assertFalse(api.collections().create.called) @@ -554,6 +556,10 @@ class TestContainer(unittest.TestCase): arvjob.output_callback.assert_called_with({"out": "stuff"}, "success") runner.add_intermediate_output.assert_called_with("zzzzz-4zz18-zzzzzzzzzzzzzz2") + runner.api.container_requests().update.assert_called_with(uuid="zzzzz-xvhdp-zzzzzzzzzzzzzz1", + body={'container_request': {'properties': {'cwl_output': {'out': 'stuff'}}}}) + + # Test to make sure we dont call runtime_status_update if we already did # some where higher up in the call stack @mock.patch("arvados_cwl.util.get_current_container") @@ -637,7 +643,8 @@ class TestContainer(unittest.TestCase): "output_uuid": "zzzzz-4zz18-zzzzzzzzzzzzzz2", "uuid": "zzzzz-xvhdp-zzzzzzzzzzzzzzz", "container_uuid": "zzzzz-8i9sb-zzzzzzzzzzzzzzz", - "modified_at": "2017-05-26T12:01:22Z" + "modified_at": "2017-05-26T12:01:22Z", + "properties": {} }) rts_mock.assert_called_with( @@ -734,7 +741,38 @@ class TestContainer(unittest.TestCase): 'command': ['ls', '/var/spool/cwl'], 'cwd': '/var/spool/cwl', 'scheduling_parameters': {}, - 'properties': {}, + 'properties': {'cwl_input': { + "p1": { + "basename": "99999999999999999999999999999994+44", + "class": "Directory", + "dirname": "/keep", + "http://arvados.org/cwl#collectionUUID": "zzzzz-4zz18-zzzzzzzzzzzzzzz", + "listing": [ + { + "basename": "file1", + "class": "File", + "dirname": "/keep/99999999999999999999999999999994+44", + "location": "keep:99999999999999999999999999999994+44/file1", + "nameext": "", + "nameroot": "file1", + "path": "/keep/99999999999999999999999999999994+44/file1", + "size": 0 + }, + { + "basename": "file2", + "class": "File", + "dirname": "/keep/99999999999999999999999999999994+44", + "location": "keep:99999999999999999999999999999994+44/file2", + "nameext": "", + "nameroot": "file2", + "path": "/keep/99999999999999999999999999999994+44/file2", + "size": 0 + } + ], + "location": "keep:99999999999999999999999999999994+44", + "path": "/keep/99999999999999999999999999999994+44" + } + }}, 'secret_mounts': {}, 'output_storage_classes': ["default"] })) @@ -828,7 +866,7 @@ class TestContainer(unittest.TestCase): 'command': ['md5sum', 'example.conf'], 'cwd': '/var/spool/cwl', 'scheduling_parameters': {}, - 'properties': {}, + 'properties': {'cwl_input': job_order}, "secret_mounts": { "/var/spool/cwl/example.conf": { "content": "username: user\npassword: blorp\n", @@ -950,7 +988,7 @@ class TestContainer(unittest.TestCase): 'command': ['ls', '/var/spool/cwl'], 'cwd': '/var/spool/cwl', 'scheduling_parameters': {}, - 'properties': {}, + 'properties': {'cwl_input': {}}, 'secret_mounts': {}, 'output_storage_classes': ["foo_sc", "bar_sc"] })) @@ -1038,6 +1076,7 @@ class TestContainer(unittest.TestCase): 'scheduling_parameters': {}, 'properties': { "baz": "blorp", + "cwl_input": {"x": "blorp"}, "foo": "bar", "quux": { "q1": 1, @@ -1146,7 +1185,7 @@ class TestContainer(unittest.TestCase): 'command': ['nvidia-smi'], 'cwd': '/var/spool/cwl', 'scheduling_parameters': {}, - 'properties': {}, + 'properties': {'cwl_input': {}}, 'secret_mounts': {}, 'output_storage_classes': ["default"] })) @@ -1220,7 +1259,7 @@ class TestContainer(unittest.TestCase): 'command': ['echo'], 'cwd': '/var/spool/cwl', 'scheduling_parameters': {}, - 'properties': {}, + 'properties': {'cwl_input': {}}, 'secret_mounts': {}, 'output_storage_classes': ["default"] } @@ -1333,7 +1372,7 @@ class TestContainer(unittest.TestCase): 'command': ['ls', '/var/spool/cwl'], 'cwd': '/var/spool/cwl', 'scheduling_parameters': sched, - 'properties': {}, + 'properties': {'cwl_input': {}}, 'secret_mounts': {}, 'output_storage_classes': ["default"] })) @@ -1522,7 +1561,19 @@ class TestWorkflow(unittest.TestCase): "output_path": "/var/spool/cwl", "output_ttl": 0, "priority": 500, - "properties": {}, + "properties": {'cwl_input': { + "fileblub": { + "basename": "token.txt", + "class": "File", + "dirname": "/keep/99999999999999999999999999999999+118", + "location": "keep:99999999999999999999999999999999+118/token.txt", + "nameext": ".txt", + "nameroot": "token", + "path": "/keep/99999999999999999999999999999999+118/token.txt", + "size": 0 + }, + "sleeptime": 5 + }}, "runtime_constraints": { "ram": 1073741824, "vcpus": 1 @@ -1595,7 +1646,7 @@ class TestWorkflow(unittest.TestCase): 'name': u'echo-subwf', 'secret_mounts': {}, 'runtime_constraints': {'API': True, 'vcpus': 3, 'ram': 1073741824}, - 'properties': {}, + 'properties': {'cwl_input': {}}, 'priority': 500, 'mounts': { '/var/spool/cwl/cwl.input.yml': {