integration-testing
Installation
SKILL.md
Integration Testing
Integration tests verify that independently built pieces (modules, services, databases, queues, third-party adapters) work together across their real interfaces. They find the bugs unit tests structurally cannot: wrong SQL, serialization mismatches, misconfigured clients, transaction and timeout behavior.
Scope
| Kind | What runs for real | What is faked |
|---|---|---|
| Narrow | One service + its real datastore/cache/queue (Testcontainers) | Other services (stubbed at HTTP level) |
| Broad / service | Several services in compose/k8s | Only external third parties |
| Contract | Consumer vs provider expectations | Both sides verified independently (contract-testing) |
Prefer many narrow tests plus contracts and a few broad ones (microservices-testing). |
Core checklist
- Persistence & transactions: full CRUD against the same engine and version as production (no in-memory substitute for a different SQL dialect); migrations apply cleanly on an empty and on a populated database; rollback on failure leaves no partial writes; constraints, unique keys, cascades; concurrent transactions and pool behavior (
concurrency-race-condition-testing). - Messaging: publish/consume, serialization and schema compatibility, idempotent consumers, retries, DLQ routing, ordering assumptions (
event-driven-messaging-testing). - HTTP clients and adapters: timeouts, retries with backoff and jitter, circuit-breaker open/half-open, handling of 4xx/5xx/slow/malformed/empty responses, auth token refresh. Stub servers: WireMock, MockServer, MSW, Prism.
- Configuration wiring: the real DI container/app context boots; env vars and secrets resolve; health/readiness endpoints report dependency status.
- Security boundaries: authorization enforced at the service and data layer, not just in the controller.
- Time and files: scheduled jobs (fake clock), file storage, temp directories, object storage (MinIO/LocalStack).