Repository navigation
Smoke tests: verify bundled imports and endpoint behaviour against a real database #328
Description
Background
Two core guarantees are only meaningful against a live database, so unit tests cannot establish them,
and neither is currently covered as a feature in its own right.
Bundled imports should result in a clean import. A section exists covering per-source
conflict-resolution rule files, but it is framed around one issue's rule files rather than the general
guarantee that a fresh install seeds the bundled content with nothing left needing review.
Endpoints need exercising against an actual database. The endpoint tests replace IQuoteService
with FakeQuoteService and IDatabaseInitializer with NoOpDatabaseInitializer by design, so they
deliberately never touch SQL. That is the right call for those tests, but it means no test proves the
endpoints behave correctly against real data. This gap has bitten before: readers translating
pageSize = 0 into LIMIT 0 instead of LIMIT -1 passed every endpoint test because the stubs echoed
their input back, and were only caught by a live pass.
#339 restructures the suite into docs/automated-testing/ first. This issue authors its sections as
documents in that structure rather than as sections of the removed monolith.
What needs to be done
- A test verifying that a fresh container seeds every bundled source and finishes with zero pending
import actions — the clean-import guarantee stated as its own check, independent of any one issue's
rule files. - That test asserts bundled entity counts are all non-zero and that no import action remains in a state
needing review. - A test exercising the read endpoints against the real seeded database — the paginated list endpoints,
theirGET /{id}counterparts, and the masterdata endpoints — asserting real returned data, not just
status codes. - Endpoint coverage targets what neither a stub-backed endpoint test nor an existing repository-level
test already proves. ThepageSize = 0class is not that:
SqliteRepositoryTests.GetPageAsync_PageSizeZero_ReturnsEveryRowAsOnePagealready covers the generic
repository every masterdata endpoint uses, andAuditEntryReaderTests,ImportActionWriterReaderTests,
NotificationReaderTests,SqliteFileResourceRepositoryTestsandSqliteQuoteServiceTestscover the
hand-written readers. What the live tier adds is the whole path end to end against the real bundled
dataset — real row counts, real reference resolution, real translations — which no test with a
constructed fixture reaches. Each case states which of those it proves. - Both tests are independent of every other test and of each other: each creates, seeds, and destroys
its own container and volume. - Neither asserts a specific migration number or schema version.
- Each document carries Restructure the T2 suite into docs/automated-testing/, one document per test #339's template fields, including Determinism and its smoke-set designation.
The proposed designation goes in the plan doc for approval — the clean-import check is a strong smoke
candidate, since a fresh container failing to seed cleanly invalidates most other tests. - Where either test needs fixture files or expected-output samples, they go in a subfolder beside the
document; any script goes toscripts/testing/, per Restructure the T2 suite into docs/automated-testing/, one document per test #339. - Boyscout: while working these endpoints, cover their id handling in both casings. Case-insensitive id handling is proven in SQL but unverified at the endpoints #341 owns the
systematic sweep across every by-id endpoint; this issue is already exercising the ones the bundled
import path touches, so covering them here is cheaper than a second visit. Record what is covered so
Case-insensitive id handling is proven in SQL but unverified at the endpoints #341 does not duplicate it — and if one turns out wrong, that is Case-insensitive id handling is proven in SQL but unverified at the endpoints #341's bug to own, not a scope
expansion of this issue.
Expected tests
Live/T2 only — the point is precisely what unit tests with stubbed services cannot reach, and what
repository-level tests with constructed fixtures cannot reach either.
| Test class | Test method | Starts |
|---|---|---|
| — | Live tests only | ❌ |
Definition of done
- All expected tests listed above start red before implementation
- All requirements implemented
- All expected tests pass (green)
- No regression in related tests
- Findings summarised in a closing comment
Activity
docs: add #326, #327 and #328 to the milestone overview
docs: review the milestone order against this session's findings
docs: plan docs for every unplanned issue, and bring overview.md back…
docs [#339]: move the identity-and-casing tests, and correct what the…