[ARVADOS] updated: 1cdb5cbf83d34cb1a19c78478a7d5a28738e7bbf
Git user
git at public.curoverse.com
Fri Jan 20 12:25:59 EST 2017
Summary of changes:
sdk/cwl/arvados_cwl/__init__.py | 4 ++--
sdk/cwl/tests/test_submit.py | 41 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 2 deletions(-)
via 1cdb5cbf83d34cb1a19c78478a7d5a28738e7bbf (commit)
from de4ecbc700759ff22e76948a58f7d70e5d3c1464 (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 1cdb5cbf83d34cb1a19c78478a7d5a28738e7bbf
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Fri Jan 20 12:25:51 2017 -0500
10812: Add tests
diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index 5d83300..b766cec 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -388,7 +388,7 @@ class ArvCwlRunner(object):
self.output_name,
self.output_tags,
submit_runner_ram=kwargs.get("submit_runner_ram"),
- name=kwargs["name"],
+ name=kwargs.get("name"),
on_error=kwargs.get("on_error"),
submit_runner_image=kwargs.get("submit_runner_image"))
elif self.work_api == "jobs":
@@ -396,7 +396,7 @@ class ArvCwlRunner(object):
self.output_name,
self.output_tags,
submit_runner_ram=kwargs.get("submit_runner_ram"),
- name=kwargs["name"],
+ name=kwargs.get("name"),
on_error=kwargs.get("on_error"),
submit_runner_image=kwargs.get("submit_runner_image"))
diff --git a/sdk/cwl/tests/test_submit.py b/sdk/cwl/tests/test_submit.py
index 13cc483..042272e 100644
--- a/sdk/cwl/tests/test_submit.py
+++ b/sdk/cwl/tests/test_submit.py
@@ -752,6 +752,47 @@ class TestSubmit(unittest.TestCase):
stubs.expect_container_request_uuid + '\n')
+ @stubs
+ def test_submit_job_runner_image(self, stubs):
+ capture_stdout = cStringIO.StringIO()
+ try:
+ exited = arvados_cwl.main(
+ ["--submit", "--no-wait", "--api=jobs", "--debug", "--submit-runner-image=arvados/jobs:123",
+ "tests/wf/submit_wf.cwl", "tests/submit_test_job.json"],
+ capture_stdout, sys.stderr, api_client=stubs.api, keep_client=stubs.keep_client)
+ self.assertEqual(exited, 0)
+ except:
+ logging.exception("")
+
+ stubs.expect_pipeline_instance["components"]["cwl-runner"]["runtime_constraints"]["docker_image"] = "arvados/jobs:123"
+
+ expect_pipeline = copy.deepcopy(stubs.expect_pipeline_instance)
+ stubs.api.pipeline_instances().create.assert_called_with(
+ body=JsonDiffMatcher(expect_pipeline))
+ self.assertEqual(capture_stdout.getvalue(),
+ stubs.expect_pipeline_uuid + '\n')
+
+ @stubs
+ def test_submit_container_runner_image(self, stubs):
+ capture_stdout = cStringIO.StringIO()
+ try:
+ exited = arvados_cwl.main(
+ ["--submit", "--no-wait", "--api=containers", "--debug", "--submit-runner-image=arvados/jobs:123",
+ "tests/wf/submit_wf.cwl", "tests/submit_test_job.json"],
+ capture_stdout, sys.stderr, api_client=stubs.api, keep_client=stubs.keep_client)
+ self.assertEqual(exited, 0)
+ except:
+ logging.exception("")
+
+ stubs.expect_container_spec["container_image"] = "arvados/jobs:123"
+
+ expect_container = copy.deepcopy(stubs.expect_container_spec)
+ stubs.api.container_requests().create.assert_called_with(
+ body=JsonDiffMatcher(expect_container))
+ self.assertEqual(capture_stdout.getvalue(),
+ stubs.expect_container_request_uuid + '\n')
+
+
@mock.patch("arvados.commands.keepdocker.find_one_image_hash")
@mock.patch("cwltool.docker.get_image")
@mock.patch("arvados.api")
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list