| name | integration-test |
| description | Write end-to-end integration tests that exercise full request-to-response flows (Priya Sharma's workflow) |
| disable-model-invocation | true |
Write integration tests for: $ARGUMENTS
Integration tests differ from unit tests โ they exercise the FULL path from HTTP request through auth, service, external resource, and back.
Step 1 โ Identify Integration Scenarios
Map complete user workflows:
- Full request lifecycle: HTTP โ Auth โ Service โ External Resource โ Response
- Multi-step workflows: Set state โ verify โ set all โ verify all
- Error recovery: Resource disconnect mid-operation โ verify state consistency
- Auth flows: No key โ rejected, wrong key โ rejected, correct key โ success
- Rate limiting: Within limit โ success, exceed limit โ 429 โ wait โ success
Step 2 โ Write Integration Test Fixtures
Create a fixture that uses the REAL DI chain โ no dependency overrides:
// Full integration fixture โ uses REAL DI chain, no overrides
fixture integration_client() {
// Initialize mock implementation, service, and app
// NO DI overrides โ tests the real dependency chain
client = new TestHTTPClient(app, propagate_errors: false)
yield client
}
Step 3 โ Write Integration Tests
Workflow tests (multi-step):
Test complete user workflows that exercise multiple endpoints in sequence.
Verify state persists between requests and final state is consistent.
Error recovery tests:
Test that errors leave the system in a consistent state.
Verify rollback behavior on partial failures.
Cross-cutting tests:
- Health endpoint returns correct status based on resource connection state
- Audit log produced for every state-changing operation
Step 4 โ Organize
Place integration tests in the integration test file (see test file mapping in project config).
Step 5 โ Verify
Run the test command (see project config) โ full suite still passes.
Rules
- Integration tests use the REAL DI chain โ minimal or no dependency overrides
- Test multi-step workflows, not individual operations
- Verify side effects (audit logs, state persistence) across steps
- Keep integration tests independent โ each test resets state