From grimoire
Guides writing integration tests that verify component interactions (database, API, message bus) with real dependencies. Covers contract testing as a lighter alternative for service boundaries.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grimoire:write-integration-testThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Write tests that verify component interactions — database, API, message bus, or service-to-service — with real or realistic dependencies.
Write tests that verify component interactions — database, API, message bus, or service-to-service — with real or realistic dependencies.
Adopted by: Google (testing pyramid doctrine), Pact.io (used by ITV, Dius, DiUS, many enterprises for contract tests) Impact: Google's testing pyramid allocates 15% of test effort to integration tests; Pact contract tests reduced ITV's integration regression cycle from 3 days to 20 minutes.
Why best: Unit tests verify logic in isolation; integration tests verify that the parts work together. Without them, systems pass unit tests but fail at the boundary — database constraints, serialization mismatches, API version drift. Contract tests (Pact) are a lighter alternative for service-to-service boundaries.
time.Sleep to wait for async operations — use polling with timeout or event-driven assertions.def test_create_order_persists_to_db(db_session, api_client):
response = api_client.post("/orders", json={"item": "widget", "qty": 2})
assert response.status_code == 201
order = db_session.query(Order).filter_by(id=response.json()["id"]).one()
assert order.qty == 2
assert order.status == "pending"
npx claudepluginhub jeffreytse/grimoire --plugin grimoireExecutes integration tests for APIs, databases, services, queues, and files using real dependencies and Docker infra. Validates component interactions without mocks.
Testing multiple components together; contract verification; real I/O (database, HTTP). Use when testing component interactions.
Sets up integration tests across databases, APIs, and message queues using Testcontainers, with DB seeding, cleanup strategies, and Docker dependencies.