X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/cbba74fcd57b7b81337d44c2e663ba317e6538de..e68177bfa8de36bd54f705e16e5c4854eafb29a2:/sdk/cwl/tests/test_container.py diff --git a/sdk/cwl/tests/test_container.py b/sdk/cwl/tests/test_container.py index e06003769b..455aa286e8 100644 --- a/sdk/cwl/tests/test_container.py +++ b/sdk/cwl/tests/test_container.py @@ -5,6 +5,9 @@ import unittest import os import functools import cwltool.process +from schema_salad.ref_resolver import Loader + +from schema_salad.ref_resolver import Loader if not os.getenv('ARVADOS_DEBUG'): logging.getLogger('arvados.cwl-runner').setLevel(logging.WARN) @@ -25,7 +28,7 @@ class TestContainer(unittest.TestCase): runner.api.collections().get().execute.return_value = { "portable_data_hash": "99999999999999999999999999999993+99"} - document_loader, avsc_names, schema_metadata, metaschema_loader = cwltool.process.get_schema("draft-3") + document_loader, avsc_names, schema_metadata, metaschema_loader = cwltool.process.get_schema("v1.0") tool = { "inputs": [], @@ -35,7 +38,7 @@ class TestContainer(unittest.TestCase): } make_fs_access=functools.partial(arvados_cwl.CollectionFsAccess, api_client=runner.api) arvtool = arvados_cwl.ArvadosCommandTool(runner, tool, work_api="containers", avsc_names=avsc_names, - basedir="", make_fs_access=make_fs_access) + basedir="", make_fs_access=make_fs_access, loader=Loader({})) arvtool.formatgraph = None for j in arvtool.job({}, mock.MagicMock(), basedir="", name="test_run", make_fs_access=make_fs_access, tmpdir="/tmp"): @@ -69,7 +72,7 @@ class TestContainer(unittest.TestCase): runner = mock.MagicMock() runner.project_uuid = "zzzzz-8i9sb-zzzzzzzzzzzzzzz" runner.ignore_docker_for_reuse = False - document_loader, avsc_names, schema_metadata, metaschema_loader = cwltool.process.get_schema("draft-3") + document_loader, avsc_names, schema_metadata, metaschema_loader = cwltool.process.get_schema("v1.0") keepdocker.return_value = [("zzzzz-4zz18-zzzzzzzzzzzzzz3", "")] runner.api.collections().get().execute.return_value = { @@ -83,12 +86,18 @@ class TestContainer(unittest.TestCase): "coresMin": 3, "ramMin": 3000, "tmpdirMin": 4000 + }, { + "class": "http://arvados.org/cwl#RuntimeConstraints", + "keep_cache": 512 + }, { + "class": "http://arvados.org/cwl#APIRequirement", }], "baseCommand": "ls" } make_fs_access=functools.partial(arvados_cwl.CollectionFsAccess, api_client=runner.api) arvtool = arvados_cwl.ArvadosCommandTool(runner, tool, work_api="containers", - avsc_names=avsc_names, make_fs_access=make_fs_access) + avsc_names=avsc_names, make_fs_access=make_fs_access, + loader=Loader({})) arvtool.formatgraph = None for j in arvtool.job({}, mock.MagicMock(), basedir="", name="test_resource_requirements", make_fs_access=make_fs_access, tmpdir="/tmp"): @@ -103,7 +112,8 @@ class TestContainer(unittest.TestCase): 'name': 'test_resource_requirements', 'runtime_constraints': { 'vcpus': 3, - 'ram': 3145728000 + 'ram': 3145728000, + 'API': True }, 'priority': 1, 'mounts': { '/var/spool/cwl': {'kind': 'tmp'}