Your pipeline has unit tests. It has mocks. It still breaks in production.
The reason is straightforward: unit tests verify isolated behavior, and mocks verify expected responses. Neither verifies that a five-step API flow actually works when step three returns a paginated response, step four's auth token expires mid-request, and step five hits a rate limit because steps two through four already consumed the quota.
Integration testing is the layer between "it works against mocks" and "it works in production." Most agent pipelines skip it entirely.
The Gap Between Mocks and Production
MockAPI.dev solved the staging environment problem. You can generate mock servers from specs, simulate failure scenarios, and replay recorded interactions. But mocks are controlled environments by definition. They return what you told them to return.
Production does not.
The failures that integration tests catch are the ones mocks cannot simulate:
- Auth token expiry mid-flow. Your token has a 15-minute TTL. Step one acquires it. Steps two through five take 18 minutes under load. Step four fails with a 401 that your retry logic interprets as a permanent auth failure, not a refresh-and-retry.
- Pagination edge cases. The API returns 100 items per page. Your test data has 50 items. Production has 10,247. Your pipeline never requests page two.
- Rate limit interactions between sequential calls. Steps two and three both hit the same upstream service. Individually, each is under the rate limit. Together, they trigger a 429 on step three that cascades into a circuit breaker trip.
- Response schema drift. The upstream API added an optional field last Tuesday. Your mock still returns the old shape. Your production pipeline handles it fine — until a downstream step tries to access the new field that your contract tests never saw.
These are not hypothetical. They are the top four categories of production incidents in multi-skill agent pipelines.
Three Integration Testing Primitives
1. Test Suite Generation ($0.003/call)
integration-test-generator takes an OpenAPI 3.x specification and produces a comprehensive integration test suite — not unit tests with mocked HTTP clients, but real request/response tests that hit live endpoints.
The generator synthesizes scenarios across five categories: happy-path flows, error boundary conditions, auth lifecycle flows (acquire, use, refresh, expire), pagination sequences (first page, middle page, last page, empty page), and rate limit behavior (under limit, at limit, over limit, backoff, recovery). Output is idiomatic test code in TypeScript, Python, Go, or Java with framework adapters for Jest, Pytest, testing-go, and JUnit.
Assertion depth is configurable. Status-only mode checks that endpoints return the right HTTP codes. Schema mode validates response bodies against the spec. Semantic mode compares field values across steps — does the ID returned in step one's POST match the ID in step two's GET?
Test ordering respects dependencies. If test C requires the resource created in test A and modified in test B, the generator resolves the dependency graph and orders execution accordingly, extracting values between steps via JSONPath.
2. Flow Validation ($0.002/call)
api-flow-validator executes multi-step API workflows end-to-end and reports structured results per step.
Define a flow as a sequence of HTTP requests where later steps consume earlier responses. Step one creates a resource and returns an ID. Step two queries that ID. Step three updates it. Step four deletes it. Step five verifies the deletion. The validator executes each step, extracts values via JSONPath for downstream consumption, and asserts per-step conditions: status codes, response times, header presence, body schema conformance, and cross-step data consistency.
Transient failures get automatic retry with exponential backoff. Each flow run has isolated state, so parallel executions do not interfere with each other. The structured flow report includes a latency waterfall showing where time was spent and first-failure identification pointing to the step that broke the chain.
This is the skill that replaces the hand-written integration test harness every team builds and nobody maintains.
3. Regression Testing ($0.004/call)
regression-test-runner captures baseline snapshots of API responses and detects meaningful changes between runs.
The runner distinguishes breaking changes from acceptable variance. A new optional field in a response body is not a regression. A removed required field is. A changed timestamp is expected. A changed price is not. Tolerance levels are configurable per field type: exact match for IDs, structural match for nested objects, semantic match for timestamps, numeric tolerance for floating-point values.
Historical trend tracking shows regression frequency by endpoint and failure category over time. If /api/users started failing every Monday after last sprint's deploy, the trend data surfaces the pattern before the next Monday.
CI-gate verdicts integrate with existing deployment infrastructure. Pass means deploy. Warn means deploy with review. Fail means block. The thresholds compose with DeployGuard canary releases (halt the rollout on regression failure) and PipelineGuard circuit breakers (trip the breaker when regression rate exceeds the configured threshold).
The Cost Arithmetic
For a team running 300 daily integration tests across 5 services:
| Component | Calls/day | Cost/call | Daily |
|---|---|---|---|
| Test suite generation | 10 (on spec changes) | $0.003 | $0.03 |
| Flow validation | 150 | $0.002 | $0.30 |
| Regression testing | 150 | $0.004 | $0.60 |
| Total | $0.93/day peak |
Most days you are not regenerating test suites. The steady-state cost is flow validation plus regression: $0.60/day. Averaged with periodic generation cycles, expect $0.72/day for continuous integration testing across 5 services.
Compare that to the cost of a production incident caused by a pagination bug that a 12-line integration test would have caught.
How They Compose
APIFlowTest.dev skills connect to the existing BluePages API lifecycle chain:
- SpecLint.dev validates your OpenAPI spec
- APIDocGen.dev generates documentation from the validated spec
- MockAPI.dev creates mock servers for development-time testing
- APIFlowTest.dev validates real flows against live or staging endpoints
- DeployGuard gates deployment on test results
The full chain: lint, document, mock, test, deploy. Each step is a skill call. Each call is metered. The integration testing step is the one most teams skip — and the one that catches the failures between "works against mocks" and "works in production."
APIFlowTest.dev also composes laterally:
- TestHarness.dev generates contract snapshots from mock responses. APIFlowTest.dev runs those same assertions against live endpoints.
- PipelineGuard.dev trips circuit breakers on failure thresholds. Regression test failure rates feed directly into breaker configuration.
- ContractTest.dev detects breaking schema changes. Integration test generation picks up the new schema and synthesizes tests for the changed fields automatically.
When to Start Integration Testing
If your pipeline calls more than two external services, you need integration tests. The signals:
- Production failures that never reproduce in your test environment
- Pagination bugs that only surface with real data volumes
- Auth token issues that only appear under sustained load
- Rate limit failures from concurrent sequential calls to the same upstream
- "Works on my machine" issues that are really "works against mocks" issues
Test suite generation from your existing OpenAPI specs is the starting point. Flow validation is the daily driver. Regression testing is the safety net that prevents last week's fix from becoming next week's incident.
Getting Started
curl -X POST https://bluepages.xyz/api/v1/invoke/integration-test-generator \
-H "Content-Type: application/json" \
-d '{
"spec": { "openapi": "3.0.0", "...": "your spec here" },
"language": "typescript",
"framework": "jest",
"assertionDepth": "semantic",
"scenarios": ["happy-path", "error-boundary", "auth-lifecycle", "pagination"]
}'
Three skills. $0.72/day for continuous integration testing. The verification step your pipeline is missing.