[POKA-YOKE][BEZALEL] Tests: Make test skips/flakes impossible to ignore #1094

Closed
opened 2026-04-07 14:21:23 +00:00 by Timmy · 1 comment
Owner

Alexander's philosophy: smoke tests + bare green-path e2e only, runtime < 5 min. Poka-yoke ensures we cannot accidentally bypass or mask test failures.

Principles:

  • Prevention: test runner configured to fail on skipped tests (no silent opt-outs).
  • Detection: flake detection algorithm flags tests with non-deterministic pass/fail.
  • Correction: flaky tests automatically quarantined and assigned; main branch stays green.

Acceptance Criteria:

  • pytest configured to treat skips as failures unless explicitly annotated with issue link
  • CI tracks test pass/fail history and flags any test with < 95% consistency
  • Quarantine process documented: flaky test moved to quarantine/ directory + issue filed
Alexander's philosophy: smoke tests + bare green-path e2e only, runtime < 5 min. Poka-yoke ensures we cannot accidentally bypass or mask test failures. **Principles:** - Prevention: test runner configured to fail on skipped tests (no silent opt-outs). - Detection: flake detection algorithm flags tests with non-deterministic pass/fail. - Correction: flaky tests automatically quarantined and assigned; main branch stays green. **Acceptance Criteria:** - [ ] pytest configured to treat skips as failures unless explicitly annotated with issue link - [ ] CI tracks test pass/fail history and flags any test with < 95% consistency - [ ] Quarantine process documented: flaky test moved to quarantine/ directory + issue filed
claude self-assigned this 2026-04-07 14:33:43 +00:00
Member

PR #1104 created: #1104

All three acceptance criteria addressed:

  1. pytest treats skips as failuresconftest.py hooks pytest_runtest_makereport to intercept skipped tests and convert them to failures unless the reason contains an issue link (#NNN, URL, JIRA key). Env-var-gated skipif conditions and @pytest.mark.quarantine tests are exempt.

  2. Flake detectionscripts/flake_detector.py ingests pytest --json-report output, maintains a rolling .test-history.json, and exits non-zero when any test drops below 95% consistency. Requires ≥5 runs before judging a test.

  3. Quarantine process documentedtests/quarantine/ directory for holding flaky tests; docs/QUARANTINE_PROCESS.md documents the full Prevention→Detection→Correction workflow with a 30-day escalation rule.

Bonus: pytest.ini added to centralise --strict-markers, asyncio_mode, and testpaths.

PR #1104 created: https://forge.alexanderwhitestone.com/Timmy_Foundation/the-nexus/pulls/1104 All three acceptance criteria addressed: 1. **pytest treats skips as failures** — `conftest.py` hooks `pytest_runtest_makereport` to intercept skipped tests and convert them to failures unless the reason contains an issue link (`#NNN`, URL, JIRA key). Env-var-gated `skipif` conditions and `@pytest.mark.quarantine` tests are exempt. 2. **Flake detection** — `scripts/flake_detector.py` ingests `pytest --json-report` output, maintains a rolling `.test-history.json`, and exits non-zero when any test drops below 95% consistency. Requires ≥5 runs before judging a test. 3. **Quarantine process documented** — `tests/quarantine/` directory for holding flaky tests; `docs/QUARANTINE_PROCESS.md` documents the full Prevention→Detection→Correction workflow with a 30-day escalation rule. Bonus: `pytest.ini` added to centralise `--strict-markers`, `asyncio_mode`, and `testpaths`.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#1094