8000 test: protect evidence checks and statuses, and run the built documentation check by rafatahmed · Pull Request #489 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

test: protect evidence checks and statuses, and run the built documentation check - #489

Merged
rafatahmed merged 1 commit into
mainfrom
test/unprotected-guards-485
Dec 3, 2026
Merged

rafatahmed merged 1 commit into
mainfrom
test/unprotected-guards-485

Conversation

@rafatahmed
Copy link
Copy Markdown
Owner

Summary

Adds the missing tests from the test-suite quality audit (#437). No runtime code changes.

Closes #485
Closes #486
Closes #487
Closes #488

 tests/test_stock_evidence.py
+  each of 8 stock, volume and batch pH record checks refuses on its own (#485)
+  failed and missing records report `failed` / `missing` (#487)
 tests/test_batch_stability.py
+  each of 5 unknown-field checks answers `invalid_evidence` on its own (#486)
+  a failed observation reports `failed` (#487)
 .github/workflows/test.yml, docs job
+  after the Sphinx build, run the built-documentation test (#488)
 tests/test_docs_site.py
+  with FLAHAX_REQUIRE_BUILT_DOCS=1 a missing build fails instead of skipping
 tests/test_ci_coverage.py
+  the docs job must keep that step

Evidence

Each new evidence test passes on the current code and fails when the line it protects is deleted or changed, one change at a time:

Changed in a copy of the repository New tests
raise deleted: stock_evidence.py 59, 65, 88, 227, 233 fail
raise deleted: ph_evidence.py 80, 95, 169 fail
raise deleted: batch_stability.py 42, 84, 113, 149, 183 fail
status changed to passed: stock_evidence.py 321, 154, 155; batch_stability.py 282 fail
  • 17 of 17 changes caught.
  • The new test_ci_coverage assertion fails against the old workflow.
  • 18 related and documentation test modules passed locally; ruff check and format are clean. The full suite and the coverage gate are left to CI.
  • No calculation changed, so the PHREEQC golden fixture is not re-captured.

Remaining limit

  • The built-documentation test could not be run on a built site locally (no Sphinx here); the docs job of this pull request is its first run.
  • The other changes the audit did not catch (mostly comparison boundaries, and arithmetic whose slower tests were not all run) are not addressed.

Checked against earlier work

Merge Danger

Door: two-way

Blast Radius: tests

The docs job now fails if the built site lacks bench_ec.csv or materials-audit.csv.

@rafatahmed rafatahmed added the enhancement New feature or request label Dec 3, 2026
@rafatahmed rafatahmed self-assigned this Dec 3, 2026
@read-the-docs-community
Copy link
Copy Markdown

📖 1 file modified


Preview · build overview · Flahax · built Dec. 3, 2026, 6:54 p.m. UTC

@codecov
codecov Bot commented Dec 3, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (3334014) to head (3e764c7).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #489   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          155       155           
  Lines        18380     18380           
  Branches      3714      3714           
=========================================
  Hits         18380     18380           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rafatahmed
rafatahmed marked this pull request as ready for review December 3, 2026 19:11
@rafatahmed
rafatahmed merged commit f4732d2 into main Dec 3, 2026
28 checks passed
@rafatahmed
rafatahmed deleted the test/unprotected-guards-485 branch December 3, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

1 participant

0