Integration testing
Skill ahtishamshahzad/agent_dev_flow/.ai/skills/testing/integration-testing
Use to plan integration tests across module and I/O boundaries — real database, real wiring, faked externals — covering happy path, invalid input, error path, and authorization denial. For HTTP API specifics use api-integration-testing.From its SKILL.md
npx -y skills add ahtishamshahzad/agent_dev_flow --skill integration-testingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 27 days oldThe repository was created 27 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.7 KB, 964 tokens by cl100k_base, as published. Nobody here has run it
Integration Testing
Purpose
Verify that units work together across real boundaries — services + data layer + wiring, with a real database and faked externals — so bugs that live between components (not inside them) are caught. Broader than pure unit tests; the HTTP-endpoint specialization is api-integration-testing.
When to Use
- For behavior spanning modules and I/O: service → repository → database, job pipelines, multi-module workflows.
- Not for pure logic (
unit-testing) or full browser/device journeys (playwright-e2e/maestro-e2e).
Inputs
- Runner (Jest/Vitest —
testing-selection), real datastore for tests (test-environment-management), seed/factory strategy (test-data-management). - The workflow under test and its authorization rules.
Discovery Questions
- What real boundaries must participate (DB, cache, queue) vs be faked (third-party APIs)?
- How does a test get an isolated real datastore per run/test?
- Which workflows carry authorization rules that must be verified, not assumed?
Responsibilities
- Exercise the real wiring: real database (same engine as production — never SQLite-for-Postgres), real repositories/services; fake only true externals (
../../backend/third-party-integrationsinterfaces). - Cover the required cases per workflow: happy path, invalid input (rejected at the right boundary), error path (dependency failure handled, no partial state —
../../database/transactions), and authorization denial (an actor lacking rights is refused —../../backend/backend-authorization). - Manage data with factories + isolation (
test-data-management), so tests own their state and don't depend on order. - Assert observable outcomes: returned values, persisted state, emitted effects — not internal calls.
- Keep the suite hermetic and parallelizable; wire as a CI tier (
../../devops/ci-cd).
Required Workflow
- Choose real-vs-faked boundaries for the workflow.
- Set up isolated real datastore + factories.
- Cover happy / invalid-input / error-path / authorization-denial.
- Assert persisted + returned state; verify no partial writes on failure.
- Wire into CI; keep runtime bounded.
Decision Rules
- Same datastore engine as production, always — engine differences hide real bugs.
- Authorization denial is a required integration case wherever rules exist — a missing denial test is a missing control.
- Fake externals at your own interface, not by mocking the data layer (that would make it a slow unit test).
- Isolation via transaction-rollback or truncate-per-test; no shared mutable seed database.
Rules
- No real third-party calls or emails from tests.
- Tests own their data; no execution-order dependence.
- Fixes at this layer land with regression tests (
regression-testing).
Anti-Patterns
- Mocking the database in an "integration" test.
- Covering happy paths only; skipping error and authorization-denial cases.
- One shared seeded DB mutated across the suite.
- Asserting exact error strings instead of codes/shapes.
- SQLite standing in for the production engine.
Validation Checklist
- Real boundaries participate; externals faked at interfaces.
- Happy + invalid-input + error-path + authorization-denial covered.
- Isolated real datastore; factory-driven data.
- Persisted + returned state asserted; no partial writes on failure.
- Hermetic, parallel, CI-wired.
Definition of Done
An integration suite exercising real wiring and a production-engine datastore, covering happy, invalid-input, error, and authorization-denial paths per workflow — hermetic, isolated, and CI-gating.
Related Skills
testing-selection, unit-testing, api-integration-testing, test-data-management, test-environment-management, regression-testing, ../../backend/backend-authorization, ../../database/transactions, ../../devops/ci-cd.
Related Knowledge
../../../knowledge/ (workflows, authorization rules).
Related References
../../../references/testing/ (patterns, when populated).
Context Loading Guidance
- Requires: the workflow + its authorization rules, datastore/factory strategy.
- Does not require: unit internals, full app source, unrelated workflows.
- May load:
test-data-management,api-integration-testing. - Stop when: the workflow's required cases pass hermetically.
Token Efficiency Guidance
Drive coverage from the workflow × required-case matrix; read the workflow's modules, not the whole app.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.