(hq_env: HqEnv)
| 271 | |
| 272 | |
| 273 | def test_task_resources_allocate_string(hq_env: HqEnv): |
| 274 | hq_env.start_server() |
| 275 | hq_env.start_worker(args=["--resource", "foo=[a,b,c]"]) |
| 276 | |
| 277 | hq_env.command( |
| 278 | [ |
| 279 | "submit", |
| 280 | "--array=1-4", |
| 281 | "--resource", |
| 282 | "foo=2", |
| 283 | "--", |
| 284 | "bash", |
| 285 | "-c", |
| 286 | "echo $HQ_RESOURCE_VALUES_foo", |
| 287 | ] |
| 288 | ) |
| 289 | wait_for_job_state(hq_env, 1, "FINISHED") |
| 290 | |
| 291 | for task_id in range(1, 5): |
| 292 | with open(default_task_output(task_id=task_id)) as f: |
| 293 | indices = set(f.read().rstrip().split(",")) |
| 294 | assert len(indices) == 2 |
| 295 | assert indices.issubset(("a", "b", "c")) |
| 296 | |
| 297 | |
| 298 | def test_worker_resource_hwdetect_mem(hq_env: HqEnv): |
nothing calls this directly
no test coverage detected