(hq_env: HqEnv)
| 14 | |
| 15 | |
| 16 | def test_worker_resources_display(hq_env: HqEnv): |
| 17 | hq_env.start_server() |
| 18 | hq_env.start_worker( |
| 19 | cpus="4x2", |
| 20 | args=[ |
| 21 | "--resource", |
| 22 | "potato=range(1-12)", |
| 23 | "--resource", |
| 24 | "fairy=sum(1000_1000)", |
| 25 | "--resource", |
| 26 | "shark=[1,3,5,2]", |
| 27 | "--resource", |
| 28 | "small=sum(0.5)", |
| 29 | ], |
| 30 | ) |
| 31 | table = hq_env.command(["worker", "list"], as_table=True) |
| 32 | assert table.get_column_value("Resources") == ["cpus 4x2; fairy 10001000; potato 12; shark 4; small 0.5"] |
| 33 | |
| 34 | table = hq_env.command(["worker", "info", "1"], as_table=True) |
| 35 | print(table.get_row_value("Resources")) |
| 36 | assert table.get_row_value("Resources") == "cpus: 4x2\nfairy: 10001000\npotato: 12\nshark: 4\nsmall: 0.5" |
| 37 | |
| 38 | |
| 39 | def test_task_resources_ignore_worker_without_resource(hq_env: HqEnv): |
nothing calls this directly
no test coverage detected