Skip to content

Commit

Permalink
Add (lousy) detection of schedulers other than Slurm.
Browse files Browse the repository at this point in the history
  • Loading branch information
hategan committed Jan 13, 2024
1 parent 4e86a17 commit 0726a3e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ def _translate_executor(config: Dict[str, str], executor: str) -> List[str]:
if executor == 'auto_q':
if config.option.environment.get('has_slurm'):
return ['slurm']
elif config.option.environment.get('has_pbs'):
return ['pbs']

Check warning on line 127 in tests/conftest.py

View check run for this annotation

Codecov / codecov/patch

tests/conftest.py#L127

Added line #L127 was not covered by tests
elif config.option.environment.get('has_lsf'):
return ['lsf']

Check warning on line 129 in tests/conftest.py

View check run for this annotation

Codecov / codecov/patch

tests/conftest.py#L129

Added line #L129 was not covered by tests
elif config.option.environment.get('has_cobalt'):
return ['cobalt']

Check warning on line 131 in tests/conftest.py

View check run for this annotation

Codecov / codecov/patch

tests/conftest.py#L131

Added line #L131 was not covered by tests
elif config.option.environment.get('has_flux'):
return ['flux']
else:
Expand Down Expand Up @@ -408,6 +414,10 @@ def _discover_environment(config):
logger.warning('Cannot get git repository information.')
try:
env['has_slurm'] = shutil.which('sbatch') is not None
if not 'has_slurm' in env:
env['has_pbs'] = shutil.which('qsub') is not None

Check warning on line 418 in tests/conftest.py

View check run for this annotation

Codecov / codecov/patch

tests/conftest.py#L418

Added line #L418 was not covered by tests
env['has_lsf'] = shutil.which('bsub') is not None
env['has_cobalt'] = shutil.which('cqsub') is not None
env['has_mpirun'] = shutil.which('mpirun') is not None
env['has_flux'] = _has_flux()
env['can_ssh_to_localhost'] = _try_run_command(['ssh', '-oBatchMode=yes',
Expand Down

0 comments on commit 0726a3e

Please sign in to comment.