Skip to content

Commit 71169b1

Browse files
committed
docs(developer-guide): document regression baseline update workflow and guidelines
1 parent 2fb1198 commit 71169b1

1 file changed

Lines changed: 36 additions & 3 deletions

File tree

docs/developer_guide.rst

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,46 @@ Run tests with coverage::
6060

6161
pytest --cov CodeEntropy --cov-report=term-missing
6262

63-
Update regression baselines::
63+
Run a specific test::
64+
65+
pytest tests/unit/.../test_file.py::test_function
66+
67+
Updating Regression Baselines
68+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69+
70+
Regression baselines should only be updated when a change intentionally alters
71+
the expected numerical output of CodeEntropy. Do not update baselines simply
72+
because a regression test fails.
73+
74+
Before updating baselines, confirm that:
75+
76+
- The code change is intentional and understood.
77+
- The new output has been reviewed.
78+
- The regression difference is expected.
79+
- The pull request explains why the baselines changed.
80+
81+
For local updates, run::
6482

6583
pytest tests/regression --update-baselines
6684

67-
Run a specific test::
85+
For pull requests, baselines can also be updated using the GitHub Actions
86+
workflow **Update Regression Baselines**.
6887

69-
pytest tests/unit/.../test_file.py::test_function
88+
To use it:
89+
90+
1. Push your changes to your PR branch.
91+
2. Open the **Actions** tab on GitHub.
92+
3. Select **Update Regression Baselines**.
93+
4. Click **Run workflow**.
94+
5. Select your PR branch.
95+
6. Run the workflow.
96+
97+
The workflow runs the regression tests with ``--update-baselines`` and commits
98+
any changed baseline files back to the selected branch.
99+
100+
Only use this workflow when the baseline changes are intentional. If a regression
101+
test fails unexpectedly, investigate the failure instead of updating the
102+
baseline.
70103

71104
Regression Test Data
72105
--------------------

0 commit comments

Comments
 (0)