Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/update_regression_baselines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 17 additions & 2 deletions tests/regression/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Loading