Add explicit path to spawner and singleuser commands

This commit is contained in:
Benoît Seignovert 2024-03-18 17:57:20 +01:00
parent 7792d567f5
commit 6af885f148
Signed by: Benoît Seignovert
GPG key ID: F5D8895227D18A0B
2 changed files with 28 additions and 1 deletions

View file

@ -1,5 +1,6 @@
"""Test GLiCID spawner module."""
import re
from collections import namedtuple
from itertools import repeat
@ -22,6 +23,10 @@ def test_spawner_config():
assert spawner.batchspawner_singleuser_cmd == 'glicid-spawner-singleuser'
cmd = spawner.cmd_formatted_for_batch()
assert 'bin/glicid-spawner-singleuser' in cmd
assert 'bin/jupyterhub-singleuser' in cmd
assert spawner.req_mamba_root_prefix == '/micromamba/operator'
assert spawner.req_mamba_exe == '/micromamba/operator/bin/micromamba'
assert spawner.req_job_name == 'jupyterhub_glicid'
@ -49,7 +54,9 @@ def test_spawner_batch_script(monkeypatch):
)
script = format_template(
spawner.batch_script, **(spawner.get_req_subvars() | spawner.user_options)
spawner.batch_script,
cmd=spawner.cmd_formatted_for_batch(),
**(spawner.get_req_subvars() | spawner.user_options),
)
assert '#SBATCH --job-name=jupyterhub_glicid' in script
@ -65,6 +72,8 @@ def test_spawner_batch_script(monkeypatch):
assert 'export MAMBA_ROOT_PREFIX=/micromamba/operator;' in script
assert 'micromamba activate /micromamba/john-doe/envs/foo;' in script
assert re.search(r'.*/bin/glicid-spawner-singleuser .*/bin/jupyterhub-singleuser', script)
def test_spawner_parse_job_id():
"""Test spawner job id parser."""