From 7e8ee556b669469429d228a0aa0651dcb4e21111 Mon Sep 17 00:00:00 2001 From: Arjun Rao Date: Tue, 27 Oct 2026 15:58:32 -0500 Subject: [PATCH] Run the test suite in parallel and skip the git-only test outside git --- makefile | 2 +- requirements.txt | 1 + tests/test_standard_sim_polish.py | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 887811eb..35a65eb2 100644 --- a/makefile +++ b/makefile @@ -320,7 +320,7 @@ typecheck: --exclude '(^|/)($(BOBLIB_PATH)|common/deploy/(build|dist))/' test: - $(RUN) $(PYTHON) -m pytest tests + $(RUN) $(PYTHON) -m pytest -n auto tests regression-invariants: $(RUN) $(PYTHON) -m pytest tests/test_simulation_regression.py diff --git a/requirements.txt b/requirements.txt index 891ccf9a..3958ee5c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,6 +15,7 @@ matplotlib==3.10.9 ruff==0.15.12 mypy==1.20.2 pytest==9.1.0 +pytest-xdist==3.6.1 # FMU interface # fmpy diff --git a/tests/test_standard_sim_polish.py b/tests/test_standard_sim_polish.py index 6374dac6..a0735e8b 100644 --- a/tests/test_standard_sim_polish.py +++ b/tests/test_standard_sim_polish.py @@ -106,10 +106,13 @@ def test_bobsim_sources_do_not_reference_legacy_boblib_generation_layout() -> No ":(exclude)engines/boblib/**", ], cwd=ROOT, - check=True, + check=False, stdout=subprocess.PIPE, + stderr=subprocess.PIPE, text=True, ) + if completed.returncode != 0: + pytest.skip(f"git cannot list the sources here: {completed.stderr.strip()}") searchable_suffixes = {".md", ".mo", ".mos", ".py", ".toml", ".yaml", ".yml"} searchable_names = {"Dockerfile", "makefile"} legacy = "BobLib"