Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for --error and --output as sbatch_args in test_submitter #638

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions pydra/engine/tests/test_submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,40 @@ def test_slurm_args_2(tmpdir):
sub(task)


@need_slurm
def test_slurm_args_3(tmpdir):
"""testing sbatch_args provided to the submitter
test should pass when valid error sbatch_args is provided
"""
task = sleep_add_one(x=1)
task.cache_dir = tmpdir
# submit workflow and every task as slurm job
with Submitter("slurm", sbatch_args="--error=error.log") as sub:
sub(task)

res = task.result()
assert res.output.out == 2
error_log_file = tmpdir / "SlurmWorker_scripts"
assert error_log_file.exists()


@need_slurm
def test_slurm_args_4(tmpdir):
"""testing sbatch_args provided to the submitter
test should pass when valid output sbatch_args is provided
"""
task = sleep_add_one(x=1)
task.cache_dir = tmpdir
# submit workflow and every task as slurm job
with Submitter("slurm", sbatch_args="--output=output.log") as sub:
sub(task)

res = task.result()
assert res.output.out == 2
output_log_file = tmpdir / "SlurmWorker_scripts"
assert output_log_file.exists()


@mark.task
def sleep(x, job_name_part):
time.sleep(x)
Expand Down