-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test_submission_script with adjusted settings for SGE
- Loading branch information
1 parent
2a74639
commit 573641e
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -236,3 +236,40 @@ def test_check_convert_qresources(self, sge_io): | |
UnsupportedResourcesError, match=r"Keys not supported: rerunnable" | ||
): | ||
sge_io.check_convert_qresources(res) | ||
|
||
def test_submission_script(self, sge_io, maximalist_qresources): | ||
# remove unsupported SGE options | ||
maximalist_qresources.rerunnable = None | ||
maximalist_qresources.project = None | ||
maximalist_qresources.account = None | ||
maximalist_qresources.qos = None | ||
maximalist_qresources.process_placement = ProcessPlacement.EVENLY_DISTRIBUTED | ||
|
||
# Set `processes` to None to avoid the conflict | ||
maximalist_qresources.processes = None | ||
|
||
# generate the SGE submission script | ||
script_qresources = sge_io.get_submission_script( | ||
commands=["ls -l"], options=maximalist_qresources | ||
) | ||
|
||
# assert the correctness of the generated script | ||
assert ( | ||
script_qresources.split("\n") | ||
== """#!/bin/bash | ||
#$ -q test_queue | ||
#$ -N test_job | ||
#$ -l select=1:ncpus=1:mpiprocs=1:mem=1000mb | ||
#$ -l h_rt=0:1:40 | ||
#$ -l s_rt=0:1:30 | ||
#$ -binding scatter | ||
#$ -M [email protected] | ||
#$ -m abe | ||
#$ -o test_output_filepath | ||
#$ -e test_error_filepath | ||
#$ -p 1 | ||
ls -l""".split( | ||
"\n" | ||
) | ||
) |