-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3358 from matthewrmshin/unittest-batch_sys_handle…
…rs-slurm-and-lsf Unit test batch sys handlers slurm and lsf
- Loading branch information
Showing
9 changed files
with
194 additions
and
92 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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. | ||
# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import pytest | ||
|
||
from cylc.flow.batch_sys_handlers.lsf import BATCH_SYS_HANDLER | ||
|
||
|
||
@pytest.mark.parametrize( | ||
'job_conf,lines', | ||
[ | ||
( # basic | ||
{ | ||
'batch_system_conf': {}, | ||
'directives': {}, | ||
'execution_time_limit': 180, | ||
'job_file_path': '$HOME/cylc-run/chop/log/job/1/axe/01/job', | ||
'suite_name': 'chop', | ||
'task_id': 'axe.1', | ||
}, | ||
[ | ||
'#BSUB -J axe.1.chop', | ||
'#BSUB -o cylc-run/chop/log/job/1/axe/01/job.out', | ||
'#BSUB -e cylc-run/chop/log/job/1/axe/01/job.err', | ||
'#BSUB -W 3', | ||
], | ||
), | ||
( # some useful directives | ||
{ | ||
'batch_system_conf': {}, | ||
'directives': { | ||
'-q': 'forever', | ||
'-B': '', | ||
'-ar': '', | ||
}, | ||
'execution_time_limit': 200, | ||
'job_file_path': '$HOME/cylc-run/chop/log/job/1/axe/01/job', | ||
'suite_name': 'chop', | ||
'task_id': 'axe.1', | ||
}, | ||
[ | ||
'#BSUB -J axe.1.chop', | ||
'#BSUB -o cylc-run/chop/log/job/1/axe/01/job.out', | ||
'#BSUB -e cylc-run/chop/log/job/1/axe/01/job.err', | ||
'#BSUB -W 4', | ||
'#BSUB -q forever', | ||
'#BSUB -B', | ||
'#BSUB -ar', | ||
], | ||
), | ||
], | ||
) | ||
def test_format_directives(job_conf: dict, lines: list): | ||
assert BATCH_SYS_HANDLER.format_directives(job_conf) == lines | ||
|
||
|
||
def test_get_submit_stdin(): | ||
outs = BATCH_SYS_HANDLER.get_submit_stdin(__file__, None) | ||
assert outs[0].name == __file__ | ||
assert outs[1] is None |
Oops, something went wrong.