Skip to content

Commit 651e54d

Browse files
committed
add tests for --error and --output sbatch_args
1 parent 5ada4ca commit 651e54d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

pydra/engine/tests/test_submitter.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,40 @@ def test_slurm_args_2(tmpdir):
299299
sub(task)
300300

301301

302+
@need_slurm
303+
def test_slurm_args_3(tmpdir):
304+
"""testing sbatch_args provided to the submitter
305+
test should pass when valid error sbatch_args is provided
306+
"""
307+
task = sleep_add_one(x=1)
308+
task.cache_dir = tmpdir
309+
# submit workflow and every task as slurm job
310+
with Submitter("slurm", sbatch_args="--error=error.log") as sub:
311+
sub(task)
312+
313+
res = task.result()
314+
assert res.output.out == 2
315+
error_log_file = tmpdir / "SlurmWorker_scripts"
316+
assert error_log_file.exists()
317+
318+
319+
@need_slurm
320+
def test_slurm_args_4(tmpdir):
321+
"""testing sbatch_args provided to the submitter
322+
test should pass when valid output sbatch_args is provided
323+
"""
324+
task = sleep_add_one(x=1)
325+
task.cache_dir = tmpdir
326+
# submit workflow and every task as slurm job
327+
with Submitter("slurm", sbatch_args="--output=output.log") as sub:
328+
sub(task)
329+
330+
res = task.result()
331+
assert res.output.out == 2
332+
output_log_file = tmpdir / "SlurmWorker_scripts"
333+
assert output_log_file.exists()
334+
335+
302336
@mark.task
303337
def sleep(x, job_name_part):
304338
time.sleep(x)

0 commit comments

Comments
 (0)