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

Function test_pbs_queue_qsub_args

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

Source from the content-addressed store, hash-verified

37
38
39def test_pbs_queue_qsub_args(hq_env: HqEnv):
40 manager = ExtractSubmitScriptPath(PbsManagerFlavor().create_adapter())
41
42 with MockJobManager(hq_env, manager):
43 start_server_with_quick_refresh(hq_env)
44 prepare_tasks(hq_env)
45
46 add_queue(
47 hq_env,
48 manager="pbs",
49 time_limit="3m",
50 additional_args="--foo=bar a b --baz 42",
51 )
52 qsub_script_path = manager.get_script_path()
53
54 with open(qsub_script_path) as f:
55 data = f.read()
56 pbs_args = extract_script_args(data, "#PBS")
57 assert pbs_args == [
58 "-l select=1",
59 "-N hq-1-1",
60 f"-o {join(dirname(qsub_script_path), 'stdout')}",
61 f"-e {join(dirname(qsub_script_path), 'stderr')}",
62 "-l walltime=00:03:00",
63 "--foo=bar a b --baz 42",
64 ]
65
66
67def test_slurm_queue_sbatch_args(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 9

get_script_pathMethod · 0.95
PbsManagerFlavorClass · 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