MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / test_slurm_queue_sbatch_args

Function test_slurm_queue_sbatch_args

tests/autoalloc/test_autoalloc.py:67–91  ·  view source on GitHub ↗
(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

65
66
67def test_slurm_queue_sbatch_args(hq_env: HqEnv):
68 manager = ExtractSubmitScriptPath(SlurmManagerFlavor().create_adapter())
69
70 with MockJobManager(hq_env, manager):
71 start_server_with_quick_refresh(hq_env)
72 prepare_tasks(hq_env)
73
74 add_queue(
75 hq_env,
76 manager="slurm",
77 time_limit="3m",
78 additional_args="--foo=bar a b --baz 42",
79 )
80 sbatch_script_path = manager.get_script_path()
81 with open(sbatch_script_path) as f:
82 data = f.read()
83 slurm_args = extract_script_args(data, "#SBATCH")
84 assert slurm_args == [
85 "--nodes=1",
86 "--job-name=hq-1-1",
87 f"--output={join(dirname(sbatch_script_path), 'stdout')}",
88 f"--error={join(dirname(sbatch_script_path), 'stderr')}",
89 "--time=00:03:00",
90 "--foo=bar a b --baz 42",
91 ]
92
93
94def test_slurm_queue_sbatch_additional_output(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 9

get_script_pathMethod · 0.95
SlurmManagerFlavorClass · 0.85
MockJobManagerClass · 0.85
prepare_tasksFunction · 0.85
extract_script_argsFunction · 0.85
add_queueFunction · 0.70
create_adapterMethod · 0.45

Tested by

no test coverage detected