Repository navigation
test(checkpoint): replace vacuous interface tests with behavioural co… - #229
Open
N-otorious wants to merge 1 commit into
Open
N-otorious wants to merge 1 commit into
N-otorious wants to merge 1 commit into
Conversation
…verage The existing checkpoint.test.ts only asserted on TypeScript interface literals — no runtime code was exercised. commitBatch and hasCheckpoint in src/indexer/checkpoint.ts were at 0% coverage despite implementing the exactly-once ingest guarantee from Miracle656#101. Replaces the three no-op cases with 14 behavioural tests against a mocked Prisma client, covering the three outcomes that matter: - fresh batch inserts and advances the checkpoint - replayed batchId is a no-op (idempotent via skipDuplicates) - failed insert propagates the error and leaves the checkpoint upsert unreached checkpoint.ts moves from 0% to 86.95% statement coverage. checkpoint.ts is still not wired into startIndexer().
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test(checkpoint): replace vacuous interface tests with behavioural coverage
The existing checkpoint.test.ts only asserted on TypeScript interface literals — no runtime code was exercised.
commitBatch and hasCheckpoint in src/indexer/checkpoint.ts were at 0% coverage despite implementing the
exactly-once ingest guarantee from #101.
This PR replaces the three no-op cases with 14 behavioural tests against a mocked Prisma client, covering the three
outcomes that matter for exactly-once semantics: a fresh batch inserts and advances the checkpoint; a replayed
batchId is a no-op (idempotent via skipDuplicates); a failed insert propagates the error and leaves the checkpoint
upsert unreached. checkpoint.ts moves from 0% to 86.95% statement coverage.
checkpoint.ts is still not wired into startIndexer().
closes #191