Skip to content

Commit 7f76a60

Browse files
committed
fixed up singularity tests
1 parent f0cc8a6 commit 7f76a60

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

pydra/engine/tests/test_environments.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from pathlib import Path
22
import typing as ty
3-
import attrs
43
from ..environments import Native, Docker, Singularity
54
from ..submitter import Submitter
65
from fileformats.generic import File
@@ -77,7 +76,10 @@ def newcache(x):
7776
assert attrs_values(result.outputs) == outputs_dict
7877

7978
outputs = shelly(environment=docker, cache_dir=newcache("shelly_call"))
80-
assert outputs_dict == attrs_values(outputs)
79+
# If busybox isn't found locally, then the stderr will have the download progress from
80+
# the Docker auto-pull in it
81+
for key in ["stdout", "return_code"]:
82+
assert outputs_dict[key] == attrs_values(outputs)[key]
8183

8284

8385
@no_win
@@ -127,14 +129,15 @@ def newcache(x):
127129

128130
cmd = "whoami"
129131
sing = Singularity(image="docker://alpine")
130-
shell_def = shell.define(cmd)
131-
shelly = Task(
132-
definition=shell_def,
132+
Shelly = shell.define(cmd)
133+
shelly = Shelly()
134+
shelly_job = Task(
135+
definition=shelly,
133136
submitter=Submitter(cache_dir=newcache("shelly")),
134137
name="shelly",
135138
)
136-
assert shell_def.cmdline == cmd
137-
outputs_dict = sing.execute(shelly)
139+
assert shelly.cmdline == cmd
140+
outputs_dict = sing.execute(shelly_job)
138141

139142
with Submitter(cache_dir=newcache("shelly_sub"), environment=sing) as sub:
140143
results = sub(shelly)
@@ -154,24 +157,23 @@ def newcache(x):
154157

155158
cmd = "whoami"
156159
sing = Singularity(image="docker://alpine")
157-
shell_def = shell.define(cmd)
158-
shelly = Task(
159-
definition=shell_def,
160+
Shelly = shell.define(cmd)
161+
shelly = Shelly()
162+
shelly_job = Task(
163+
definition=shelly,
160164
submitter=Submitter(cache_dir=newcache("shelly")),
161165
name="shelly",
162166
)
163-
assert shell_def.cmdline == cmd
164-
outputs_dict = sing.execute(shelly)
167+
assert shelly.cmdline == cmd
168+
outputs_dict = sing.execute(shelly_job)
165169

166170
with Submitter(worker=plugin) as sub:
167171
results = sub(shelly)
168172
assert outputs_dict == attrs_values(results.outputs)
169173

170174
outputs = shelly(environment=sing, cache_dir=newcache("shelly_call"))
171-
for key in [
172-
"stdout",
173-
"return_code",
174-
]: # singularity gives info about cashed image in stderr
175+
# singularity gives info about cashed image in stderr
176+
for key in ["stdout", "return_code"]:
175177
assert outputs_dict[key] == attrs_values(outputs)[key]
176178

177179

0 commit comments

Comments
 (0)