Add conda environment selector
This commit is contained in:
@@ -22,6 +22,19 @@ def test_build_task_sets_cuda_visible_devices(tmp_path, monkeypatch):
|
||||
assert spec.env["CUDA_VISIBLE_DEVICES"] == "2,0"
|
||||
|
||||
|
||||
def test_build_task_uses_requested_conda_env(tmp_path, monkeypatch):
|
||||
captured = {}
|
||||
|
||||
def fake_build_module_task(job_type, params, conda_env):
|
||||
captured["conda_env"] = conda_env
|
||||
return CommandSpec(["python", "-c", "print('ok')"], tmp_path, "fake task")
|
||||
|
||||
monkeypatch.setattr(jobs, "build_module_task", fake_build_module_task)
|
||||
jobs._build_task(JobCreate(type="segmodel.train", params={}, conda_env="seg_custom"))
|
||||
|
||||
assert captured["conda_env"] == "seg_custom"
|
||||
|
||||
|
||||
def test_job_progress_reports_log_size(tmp_path):
|
||||
log_path = tmp_path / "job.log"
|
||||
log_path.write_text("line one\nline two\n", encoding="utf-8")
|
||||
|
||||
Reference in New Issue
Block a user