Skip to content

Test gate 6/6 · Enforce the gate — branch protection, flakiness, speed #159

Description

@lucaosti

Sub-issue of #146layer 6 of 6. The step that turns the suite from advisory into a gate.

Goal

Make the suite genuinely block merges to master, and keep it trustworthy enough that nobody wants to bypass it.

Why this is separate

Layers 1–5 build the tests. This makes them matter. A comprehensive suite that people merge past is theatre — and the project has already lived through the failure mode: CI triggered on branches: [main, rag], neither being the default branch, so nothing ran on master for weeks and nobody noticed (fixed in #124).

Branch protection

  • Enable branch protection on master
  • Require the suite as a status check before merge
  • Require at least one approving review, per AGENTS.md
  • Require branches to be up to date before merge, so the suite runs against what will actually land
  • Prevent force-push and deletion of master
  • Decide explicitly whether administrators can bypass, and document the decision

Verify the gate actually blocks

  • Open a deliberately failing PR and confirm it cannot be merged
  • Confirm the required check is the right one — a check that always passes satisfies branch protection while protecting nothing
  • Confirm a PR from a fork, if applicable, still runs the required checks

Reliability

A flaky gate teaches people to re-run until green, which is worse than no gate — it produces the habit of ignoring red.

  • Run the full suite repeatedly on an unchanged commit; any test that is not deterministic is flaky
  • Quarantine each flaky test with its own issue; do not leave it in the required set
  • Zero tolerance for retry-until-green as a workaround
  • No silent skips: a skipped test is reported and justified

Speed

  • Measure total runtime
  • If too slow to respect, split: fast checks on every push, full suite required before merge
  • Cache dependencies and models in CI where possible — model downloads dominate otherwise

Documentation

Acceptance criteria

  • A PR breaking any layer cannot merge into masterverified by trying
  • Branch protection configured and documented
  • Zero flaky tests in the required set
  • Runtime acceptable, or staged
  • AGENTS.md states the gate precisely

Closing #146

When this lands, the parent issue can close: the suite exists, it is comprehensive, and it is enforced.

Metadata

Metadata

Assignees

Labels

integrationBranch integration and release workmvpRequired for the MVP

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions