test(storage): enforce conformance suite completeness - #1204
Conversation
A reflection check pins the storagetest suite registry to every storage.Storage sub-interface so a backend cannot silently skip one.
There was a problem hiding this comment.
Pull request overview
This PR makes the storage conformance suite self-validating by centralizing parity suite registration and adding a unit-testable completeness check against the storage.Storage interface, preventing backends from silently skipping new sub-interface suites.
Changes:
- Introduced an authoritative
parityFamiliesregistry and updatedstoragetest.Runto iterate it. - Added a reflection-based coverage assertion to ensure the registry covers every
storage.Storagesub-interface accessor exactly once. - Added a standalone unit test to run the coverage assertion without requiring a database/harness.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/storage/storagetest/storagetest.go | Adds parity family registry and reflection-based completeness assertion; Run now iterates the registry. |
| pkg/storage/storagetest/storagetest_test.go | Adds a unit test that exercises the completeness assertion without DB setup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The coverage check enumerates all storage.Storage methods against the registry plus an explicit Ping/Close allowlist, ties each family's suite to its method by function name, and runs only in the unit test.
|
Review response from Kiran's (@Kiran01bm) code review assessment agent (Amp / Claude Opus 4.5) Four findings fixed in a follow-up commit (the completeness check is now inverted and non-vacuous); the enginetest sibling gets the same treatment as a tracked follow-up.
Source: adversarial review of #1204 by Claude Code (claude-opus-5), delivered as an offline review doc. |
The storage conformance suite now proves it covers every storage sub-interface, so a backend cannot silently opt out of a suite.
Why
storagetest.Runinvoked each conformance suite by hand. Nothing tied that list to thestorage.Storageinterface, so adding a new sub-interface without a suite — or dropping a suite invocation — passed silently for every backend.What
The suites move into a single authoritative registry that
Runiterates, and a reflection test asserts the registry covers eachstorage.Storagesub-interface accessor exactly once. The completeness check runs as a plain unit test, without a database.Before / after