feat: add blockchain-to-notification end-to-end tests - #930
Open
pimaster900 wants to merge 2 commits into
Open
pimaster900 wants to merge 2 commits into
pimaster900 wants to merge 2 commits into
Conversation
Add end-to-end test coverage for the complete NotifyChain pipeline:
Blockchain Event → Listener → Validation → Database → Scheduler → Notification
New file:
- listener/src/__tests__/blockchain-to-notification-e2e.test.ts
7 describe blocks, 46 test cases covering:
- Stage 1: RPC response validation, event payload validation,
event filter matching, event name extraction
- Stage 2: EventRegistry (in-memory store) — add, retrieve, evict, clear
- Stage 3: NotificationDeduplicator — window-based suppression, metrics
- Stage 4: EventSubscriber with mocked RPC server — happy path, invalid
RPC, invalid payload, filter mismatch, full-contract failure
- Stage 5: NotificationAPI + SQLite — schedule, reject past date,
reject missing recipient, reject null payload
- Stage 6: NotificationScheduler — delivery, failure, not-yet-due,
batch delivery
- Stage 7: Full pipeline — event → registry → DB → scheduler → delivery,
duplicate suppression, filter rejection, delivery failure, batch
Fixes and improvements to unblock tests:
- listener/src/services/event-subscriber.ts: remove duplicate
processableEvents declaration and duplicate request declaration
left behind from a merge conflict; add missing backfillStartLedger
private field
- listener/src/services/discord-notification.ts: fix missing closing
brace on sanitizeForDiscord() left behind from a merge conflict
- listener/src/__mocks__/@stellar/stellar-sdk.ts: add xdr.ScVal stub
(scvSymbol, scvString, scvU32) with singleton ScValType constants
for switch-case equality, and scValToNative() so formatScVal works
in tests without the real Stellar SDK installed
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.
Add end-to-end test coverage for the complete NotifyChain pipeline:
Blockchain Event → Listener → Validation → Database → Scheduler → Notification
New file:
Fixes and improvements to unblock tests:
Overview
Related Issue
Closes #
Changes
Verification
How to Test
Checklist
maincargo fmt --allrun (if Rust changes)npm run lintpasses (if TypeScript changes)closes #796