(hq_env: HqEnv)
| 27 | |
| 28 | |
| 29 | def test_submit_python_prologue(hq_env: HqEnv): |
| 30 | init_sh = Path("init.sh") |
| 31 | init_sh.write_text("""export ABC=xyz""") |
| 32 | |
| 33 | hq_env.start_server() |
| 34 | hq_env.start_worker() |
| 35 | client = Client(hq_env.server_dir, python_env=PythonEnv(prologue=f"source {init_sh.resolve()}")) |
| 36 | |
| 37 | def body(): |
| 38 | print(os.environ.get("ABC")) |
| 39 | |
| 40 | job = Job() |
| 41 | job.function(body, stdout="out") |
| 42 | submitted_job = client.submit(job) |
| 43 | wait_for_job_state(hq_env, submitted_job.id, "FINISHED") |
| 44 | check_file_contents("out", "xyz\n") |
| 45 | |
| 46 | |
| 47 | def test_submit_pyfunction_fail(hq_env: HqEnv): |
nothing calls this directly
no test coverage detected