From: Peter Amstutz Date: Fri, 16 Sep 2016 15:01:59 +0000 (-0400) Subject: 10081: Fix RunInSingleContainer test X-Git-Tag: 1.1.0~705^2~10 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/98457f6fdb93116d31bec47057094041e9c47bde 10081: Fix RunInSingleContainer test --- diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py index 20bbc41bd3..0c56c8665e 100644 --- a/sdk/cwl/arvados_cwl/__init__.py +++ b/sdk/cwl/arvados_cwl/__init__.py @@ -56,6 +56,7 @@ class ArvCwlRunner(object): self.work_api = work_api self.stop_polling = threading.Event() self.poll_api = None + self.pipeline = None if self.work_api is None: # todo: autodetect API to use. @@ -373,7 +374,8 @@ def add_arv_hints(): _, cwlnames, _, _ = cwltool.process.get_schema("v1.0") _, extnames, _, _ = schema_salad.schema.load_schema("https://w3id.org/cwl/arv-cwl-schema.yml", cache=cache) for n in extnames.names: - cwlnames.add_name("http://arvados.org/cwl#"+n, "", extnames.get_name(n, "")) + if not cwlnames.has_name("http://arvados.org/cwl#"+n, ""): + cwlnames.add_name("http://arvados.org/cwl#"+n, "", extnames.get_name(n, "")) def main(args, stdout, stderr, api_client=None): parser = arg_parser() diff --git a/sdk/cwl/tests/test_job.py b/sdk/cwl/tests/test_job.py index 324e2c3d23..e95589cf65 100644 --- a/sdk/cwl/tests/test_job.py +++ b/sdk/cwl/tests/test_job.py @@ -200,6 +200,8 @@ class TestWorkflow(unittest.TestCase): # The test passes no builder.resources # Hence the default resources will apply: {'cores': 1, 'ram': 1024, 'outdirSize': 1024, 'tmpdirSize': 1024} def test_run(self): + arvados_cwl.add_arv_hints() + runner = arvados_cwl.ArvCwlRunner(mock.MagicMock()) runner.project_uuid = "zzzzz-8i9sb-zzzzzzzzzzzzzzz" runner.ignore_docker_for_reuse = False @@ -213,8 +215,10 @@ class TestWorkflow(unittest.TestCase): basedir="", make_fs_access=make_fs_access, loader=document_loader, makeTool=runner.arv_make_tool, metadata=metadata) arvtool.formatgraph = None - for j in arvtool.job({}, mock.MagicMock(), basedir="", make_fs_access=make_fs_access): - j.run() + it = arvtool.job({}, mock.MagicMock(), basedir="", make_fs_access=make_fs_access) + it.next().run() + it.next().run() + runner.api.jobs().create.assert_called_with( body={ 'minimum_script_version': '9e5b98e8f5f4727856b53447191f9c06e3da2ba6',