diff --git a/tests/runs/conftest.py b/tests/runs/conftest.py index 70cc7919..c187c0f2 100644 --- a/tests/runs/conftest.py +++ b/tests/runs/conftest.py @@ -3,15 +3,29 @@ from __future__ import annotations import os +from pathlib import Path import pytest +from sampleworks.runs import runner @pytest.fixture(autouse=True) -def force_pixi_argv(monkeypatch: pytest.MonkeyPatch) -> None: - """Keep argv assertions deterministic on machines with /app/.pixi present.""" +def force_pixi_argv(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None: + """Keep argv assertions deterministic across dev and ACTL image environments.""" monkeypatch.delenv("SAMPLEWORKS_GRID_SEARCH_SCRIPT", raising=False) monkeypatch.delenv("SAMPLEWORKS_PIXI_PROJECT_DIR", raising=False) + monkeypatch.setattr( + runner, + "WORKSPACE_GRID_SEARCH_SCRIPT", + str(tmp_path / "missing-workspace" / "run_grid_search.py"), + ) + for var in ( + "RUNTIME_PIXI", + "SAMPLEWORKS_ALLOW_RUNTIME_PIXI", + "SAMPLEWORKS_REQUIRE_PREBUILT_PIXI", + "SAMPLEWORKS_SKIP_ENV_PREPARE", + ): + monkeypatch.delenv(var, raising=False) for var in list(os.environ): if var.startswith("SAMPLEWORKS_") and var.endswith("_PYTHON"): monkeypatch.delenv(var, raising=False) diff --git a/tests/runs/test_runner.py b/tests/runs/test_runner.py index bec96b9d..26d304da 100644 --- a/tests/runs/test_runner.py +++ b/tests/runs/test_runner.py @@ -348,6 +348,7 @@ def test_pre_jobs_run_before_main_jobs(tmp_path: Path, monkeypatch: pytest.Monke """Sequential pre-jobs complete before regular jobs are launched.""" monkeypatch.setenv("HOME", str(tmp_path)) monkeypatch.setenv("SAMPLEWORKS_PIXI_PROJECT_DIR", str(tmp_path)) + monkeypatch.delenv("SAMPLEWORKS_FORCE_PIXI", raising=False) monkeypatch.setenv("SAMPLEWORKS_ANALYSIS_PYTHON", sys.executable) pre_script = tmp_path / "pre.py" main_script = tmp_path / "main.py"