diff --git a/.github/workflows/update_regression_baselines.yaml b/.github/workflows/update_regression_baselines.yaml index 1440713..9cc60de 100644 --- a/.github/workflows/update_regression_baselines.yaml +++ b/.github/workflows/update_regression_baselines.yaml @@ -33,7 +33,7 @@ jobs: python -m pip install -e .[testing] - name: Update regression baselines - run: pytest tests/regression --update-baselines + run: pytest tests/regression --update-baselines --run-slow - name: Commit updated baselines uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6 diff --git a/tests/regression/test_regression.py b/tests/regression/test_regression.py index fea359b..5006bcb 100644 --- a/tests/regression/test_regression.py +++ b/tests/regression/test_regression.py @@ -51,6 +51,18 @@ def _group_index(payload: dict[str, Any]) -> dict[str, dict[str, Any]]: return groups +def _baseline_payload(payload: dict[str, Any]) -> dict[str, Any]: + """ + Build the persisted regression baseline payload. + + Baselines intentionally store only grouped entropy results, not runtime + arguments or provenance, so they remain stable across machines and runs. + """ + return { + "groups": _group_index(payload), + } + + def _compare_grouped( *, got_payload: dict[str, Any], @@ -148,7 +160,8 @@ def test_regression_matches_baseline( options. Raises: - AssertionError: If the output does not match the baseline or baseline is missing + AssertionError: If the output does not match the baseline or + baseline is missing. """ system = case.system config_path = case.config_path @@ -176,7 +189,9 @@ def test_regression_matches_baseline( if request.config.getoption("--update-baselines"): baseline_path.parent.mkdir(parents=True, exist_ok=True) - baseline_path.write_text(json.dumps(run.payload, indent=2)) + baseline_path.write_text( + json.dumps(_baseline_payload(run.payload), indent=2) + "\n" + ) pytest.skip(f"Updated baseline for {system}") _compare_grouped(