Skip to content

Commit cdd3e8c

Browse files
authored
Merge pull request #455 from ExaWorks/more_launchers
Add typical launchers in autodetection for tests
2 parents d7debfa + 72bc6bb commit cdd3e8c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/psij/executors/batch/pbs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ def __init__(self, url: Optional[str] = None, config: Optional[PBSExecutorConfig
2222
"""
2323
if not config:
2424
config = PBSExecutorConfig()
25-
generator = TemplatedScriptGenerator(config, Path(__file__).parent / 'pbspro'
25+
generator = TemplatedScriptGenerator(config, Path(__file__).parent / 'pbs'
2626
/ 'pbspro.mustache')
2727
super().__init__(generator, url=url, config=config)

tests/conftest.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def _translate_launcher(config: Dict[str, str], exec: str, launcher: str) -> str
141141
if launcher == 'auto_l':
142142
if exec == 'slurm':
143143
return 'srun'
144+
elif exec == 'pbs':
145+
return 'mpirun'
146+
elif exec == 'lsf':
147+
return 'ibrun'
148+
144149
else:
145150
raise ValueError('Don\'t know how to get launcher for executor "' + exec + '"')
146151
else:
@@ -199,10 +204,10 @@ def pytest_configure(config):
199204

200205
_purge_old_results(config)
201206
start_time = _now()
202-
(env, key), log = _capture_log(partial(_discover_environment, config))
207+
config.option.key = _get_key(config)
208+
env, log = _capture_log(partial(_discover_environment, config))
203209
save = config.getoption('save_results')
204210
upload = config.getoption('upload_results')
205-
config.option.key = key
206211
end_time = _now()
207212
data = {}
208213
if save or upload:
@@ -394,7 +399,6 @@ def _discover_environment(config):
394399
conf['pythonpath'] = _strip_home(sys.path)
395400
conf['executors'] = config.getoption('executors')
396401
conf['maintainer_email'] = config.getoption('maintainer_email')
397-
key = _get_key(config)
398402
env['start_time'] = _now()
399403
env['run_id'] = _get_run_id(config)
400404
env['in_conda'] = _get_env('CONDA_SHLVL') != '' and _get_env('CONDA_SHLVL') != '0'
@@ -433,7 +437,7 @@ def _discover_environment(config):
433437
env['error'] = str(ex)
434438
config.option.environment = env
435439
env['computed_executors'] = _get_executors(config)
436-
return env, key
440+
return env
437441

438442

439443
def _now():

0 commit comments

Comments
 (0)