Blog · Backend · · 3 min read
Keeping known failing tests in the suite
When an automated test catches a real upstream data bug or an unresolved edge case, teams usually take one of two paths: delete or test.skip() the assertion so CI turns green, or leave the suite red until everyone stops reading the output. Skipping a test hides whether it ever got fixed; ignoring a red suite hides real regressions; softening the assertion to match broken data Goodharts the suite into lying about reality.
Ptree's release gate takes a third path: every known failure stays active in the test suite and is listed in an open-issues manifest, and the gate fails in both directions.
Failing on regressions and on unexpected passes
When the release gate runs, it executes the full suite across pure unit tests, spec contracts, served-store checks, and identity invariants, then compares the set of failing test names against the open-issues manifest:
- Any test that fails and is not in the manifest is an unlisted regression, so the gate exits non-zero and blocks the release.
- Any test listed in the manifest that now passes also fails the gate, instructing you to remove its entry.
That second rule keeps the list honest. You cannot leave a stale entry sitting in the manifest for six months after a crosswalk rebuild or upstream update fixes the underlying bug. When an upstream database merges a homonym across kingdoms or places a species under the wrong genus, the test asserting reality fails until either the crosswalk splitter resolves it or the provider fixes its dump. The first build where the fix lands forces you to delete that line from the manifest, shrinking it toward empty over time.
Because the test itself is never skipped, it still runs on every build and still verifies that the failure mode has not mutated into an unhandled exception or a broader collapse.
Tests assert reality, never the rule
A related rule governs how tests are written: a test is only useful if it has a different shape from the code that produced the result. Testing a unit converter by running the same formula twice proves nothing. Testing an identity crosswalk against real biological facts catches silent drift that self-referential unit tests miss: Batis splits into an African bird and a coastal shrub, PBDB's fossil Batis ray joins neither, and unlinked GTDB higher concepts stay unlinked instead of forcing a false match.
Content-digest memoization across builds
Running the entire verification suite against eleven taxonomic backbones and dozens of rolled-up SQLite stores takes time, and most edits touch only a small slice of the system: a stylesheet tweak, one property interpreter, or one newly refreshed source store.
To keep the gate fast without skipping coverage, a lightweight tracer memoizes passing tests safely against content digests:
- When a test runs, the tracer records the exact source modules and SQLite data stores the test actually opened during execution.
- The gate hashes the content digests of those code files and stores into a manifest beside the passing test result.
- On a later run, any test whose recorded code files and data stores have identical content digests is carried forward without re-running. Any test whose code or backing store changed, even indirectly through a shared helper, runs in full.
A failing test in the open manifest is never silently forgotten, a regression in an unrelated store is caught immediately, and a routine HTML or stylesheet rebuild does not wait minutes re-verifying untouched SQLite stores.