test(integration): rigorous-integration layer across 5 reliability tracks#119
Merged
Merged
Conversation
…acks
Adds the next layer up from existing unit tests + chaos drills:
Track 1 — Backup/restore integration tests (api/e2e/, build tag
integration_backup):
- Wraps infra/scripts/restore-drill.sh in Go test scaffolding
- Asserts RTO < 5min (postgres) / 3min (mongo), RPO < 30h
- Asserts cleanup of throwaway namespace
- Pure-parse tests for NR alert aggregation_window + Prom rule
36h/60h thresholds (run anywhere)
- .github/workflows/integration-backup.yml: weekly cron + manual
dispatch against KUBECONFIG_TEST_CLUSTER; defensive context-name
gate to prevent prod runs
Track 2 — Brevo webhook full pipeline (api/e2e/, e2e build tag):
- Registry-iterating round-trip over every documented Brevo event:
delivered/soft_bounce/hard_bounce/blocked/complaint/deferred/
unsubscribed/error
- Idempotent re-delivery pins GREATEST(delivered_at) clause
- Delivered-then-bounce pins makeClassUpdater contract (no time-travel)
- Malformed payload 400 + unhandled event 200 end-to-end
Track 3 — Propagation runner integration tests (worker/internal/jobs/,
no build tag, runs under regular make gate):
- Backoff exact-schedule via markRetry persistence for every position
- Dead-letter at maxAttempts via markDeadLettered direct
- F2 P1 guard: unknown_kind bounded retries
- FOR UPDATE SKIP LOCKED concurrency (TEST_DATABASE_URL-gated)
- Enum-vs-handler-map registry walk (TEST_DATABASE_URL-gated)
Track 4 — Deep /readyz cross-service (api/e2e/, e2e build tag):
- Envelope-shape walk across api/worker/provisioner
- Brevo unreachable → 200 degraded (NOT 503) contract
- Cache TTL: 50-burst latency assertion
- Secret-leak scan (20+ hex chars regex)
- P95 response time < 500ms
- Criticality-matrix registry walk
Track 5 — Cross-track contract test (api/e2e/, no build tag, runs
under regular gate when TEST_DATABASE_URL is set):
- Walks AuditKind* constants from api/internal/models/audit_kinds.go
via source-file regex
- Forward: every constant has a consumer spec entry
- Reverse: every spec entry refers to a real constant
- Emails=true implies Forwards=true (F4 ledger drift class)
- Propagation kinds match pending_propagations.kind enum
- Forwarder_sent.classification populated for rows > 5min old
Companion: INTEGRATION-TESTS-2026-05-20.md (repo-root) lists every
new test with the failure mode it catches, per CLAUDE.md rule 17
coverage-block discipline.
Per CLAUDE.md rule 18 (registry-iterating regression tests, not
hand-typed lists), every Track has at least one registry walk
that fails LOUD on additions to the upstream registry without
matching downstream wiring.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bbe82d9 to
f41ed2b
Compare
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.
Adds the next layer up from existing unit tests + chaos drills. Five tracks, all green locally:
Track 1 — Backup/restore integration (api/e2e/, integration_backup tag)
Track 2 — Brevo webhook full pipeline (api/e2e/, e2e tag)
Track 4 — Deep /readyz cross-service (api/e2e/, e2e tag)
Track 5 — Cross-track contract (no orphan kinds) (api/e2e/, no tag)
Companion: INTEGRATION-TESTS-2026-05-20.md (repo root) — per-test failure-mode map.
Local verified:
🤖 Generated with Claude Code