Skip to content

Commit 7427030

Browse files
author
Anton Khodak
committed
Merge branch 'master' into singularity-support
# Conflicts: # cwltool/job.py
2 parents 602b4fe + 0866dad commit 7427030

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

cwltool/builder.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def generate_arg(self, binding): # type: (Dict[Text,Any]) -> List[Text]
230230
return [prefix] if prefix else []
231231
elif value is True and prefix:
232232
return [prefix]
233-
elif value is False or value is None:
233+
elif value is False or value is None or (value is True and not prefix):
234234
return []
235235
else:
236236
l = [value]
@@ -251,7 +251,8 @@ def do_eval(self, ex, context=None, pull_image=True, recursive=False):
251251
return {k: self.do_eval(v, context, pull_image, recursive) for k, v in iteritems(ex)}
252252
if isinstance(ex, list):
253253
return [self.do_eval(v, context, pull_image, recursive) for v in ex]
254-
254+
if context is None and type(ex) is str and "self" in ex:
255+
return None
255256
return expression.do_eval(ex, self.job, self.requirements,
256257
self.outdir, self.tmpdir,
257258
self.resources,

cwltool/job.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def create_runtime(self, env, rm_container=True, **kwargs):
324324
# type: (MutableMapping[Text, Text], bool, **Any) -> List
325325
pass
326326

327+
327328
def run(self, pull_image=True, rm_container=True,
328329
rm_tmpdir=True, move_outputs="move", **kwargs):
329330
# type: (bool, bool, bool, Text, **Any) -> None

jenkins.bash

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ do
3434
# use pip2.7 and pip3 in separate loop runs
3535
pip${PYTHON_VERSION} install -U setuptools wheel pip
3636
pip${PYTHON_VERSION} install .
37-
pip${PYTHON_VERSION} install "cwltest>=1.0.20160825151655"
37+
pip${PYTHON_VERSION} install "cwltest>=1.0.20180130081614"
3838
pushd common-workflow-language
3939
# shellcheck disable=SC2154
4040
if [[ "$version" = *dev* ]]
4141
then
4242
EXTRA="EXTRA=--enable-dev"
4343
fi
44-
./run_test.sh --junit-xml=result${PYTHON_VERSION}.xml RUNNER=cwltool -j4 DRAFT=${version}
44+
./run_test.sh --junit-xml=result${PYTHON_VERSION}.xml RUNNER=cwltool \
45+
-j4 DRAFT=${version} --classname=py${PYTHON_VERSION}
4546
CODE=$(($CODE+$?)) # capture return code of ./run_test.sh
4647
deactivate
4748
popd

tests/override/echo.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ outputs:
1515
glob: out.txt
1616
loadContents: true
1717
outputEval: $(self[0].contents)
18-
arguments: ["echo", "-n", $(inputs.m1), {shellQuote: false, valueFrom: "$MESSAGE"}]
18+
arguments: ["echo", $(inputs.m1), {shellQuote: false, valueFrom: "$MESSAGE"}]
1919
stdout: out.txt

tests/test_override.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,44 @@ def test_overrides(self):
2323
self.assertEquals(main([get_data('tests/override/echo.cwl'),
2424
get_data('tests/override/echo-job.yml')],
2525
stdout=sio), 0)
26-
self.assertEquals({"out": "zing hello1"}, json.loads(sio.getvalue()))
26+
self.assertEquals({"out": "zing hello1\n"}, json.loads(sio.getvalue()))
2727

2828
sio = StringIO()
2929
self.assertEquals(main(["--overrides", get_data('tests/override/ov.yml'),
3030
get_data('tests/override/echo.cwl'),
3131
get_data('tests/override/echo-job.yml')],
3232
stdout=sio), 0)
33-
self.assertEquals({"out": "zing hello2"}, json.loads(sio.getvalue()))
33+
self.assertEquals({"out": "zing hello2\n"}, json.loads(sio.getvalue()))
3434

3535
sio = StringIO()
3636
self.assertEquals(main([get_data('tests/override/echo.cwl'),
3737
get_data('tests/override/echo-job-ov.yml')],
3838
stdout=sio), 0)
39-
self.assertEquals({"out": "zing hello3"}, json.loads(sio.getvalue()))
39+
self.assertEquals({"out": "zing hello3\n"}, json.loads(sio.getvalue()))
4040

4141
sio = StringIO()
4242
self.assertEquals(main([get_data('tests/override/echo-job-ov2.yml')],
4343
stdout=sio), 0)
44-
self.assertEquals({"out": "zing hello4"}, json.loads(sio.getvalue()))
44+
self.assertEquals({"out": "zing hello4\n"}, json.loads(sio.getvalue()))
4545

4646

4747
sio = StringIO()
4848
self.assertEquals(main(["--overrides", get_data('tests/override/ov.yml'),
4949
get_data('tests/override/echo-wf.cwl'),
5050
get_data('tests/override/echo-job.yml')],
5151
stdout=sio), 0)
52-
self.assertEquals({"out": "zing hello2"}, json.loads(sio.getvalue()))
52+
self.assertEquals({"out": "zing hello2\n"}, json.loads(sio.getvalue()))
5353

5454
sio = StringIO()
5555
self.assertEquals(main(["--overrides", get_data('tests/override/ov2.yml'),
5656
get_data('tests/override/echo-wf.cwl'),
5757
get_data('tests/override/echo-job.yml')],
5858
stdout=sio), 0)
59-
self.assertEquals({"out": "zing hello5"}, json.loads(sio.getvalue()))
59+
self.assertEquals({"out": "zing hello5\n"}, json.loads(sio.getvalue()))
6060

6161
sio = StringIO()
6262
self.assertEquals(main(["--overrides", get_data('tests/override/ov3.yml'),
6363
get_data('tests/override/echo-wf.cwl'),
6464
get_data('tests/override/echo-job.yml')],
6565
stdout=sio), 0)
66-
self.assertEquals({"out": "zing hello6"}, json.loads(sio.getvalue()))
66+
self.assertEquals({"out": "zing hello6\n"}, json.loads(sio.getvalue()))

0 commit comments

Comments
 (0)