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

Function test_resource_variants

tests/pyapi/test_job.py:276–292  ·  view source on GitHub ↗
(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

274
275
276def test_resource_variants(hq_env: HqEnv):
277 (job, client) = prepare_job_client(hq_env)
278
279 job.program(
280 args=bash("echo Hello"),
281 resources=[
282 ResourceRequest(cpus=2),
283 ResourceRequest(cpus=1, resources={"gpus": 2}),
284 ],
285 )
286 submitted_job = client.submit(job)
287
288 table = hq_env.command(["task", "info", str(submitted_job.id), "0"], as_table=True)
289 table.check_row_value(
290 "Resources",
291 "# Variant 1\ncpus: 2 compact\n# Variant 2\ncpus: 1 compact\ngpus: 2 compact",
292 )
293
294
295def test_job_forget(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 7

ResourceRequestClass · 0.90
prepare_job_clientFunction · 0.85
bashFunction · 0.85
programMethod · 0.80
commandMethod · 0.80
check_row_valueMethod · 0.80
submitMethod · 0.45

Tested by

no test coverage detected