Use it when designing, executing or reviewing automation tests around Integration Testing. Keep requirement/risk, test oracle, fixture/environment identity, exercised scope, raw observations and target/workload outcome as separate proof boundaries.
Integration Testing
Integration testing checks that real components work together across actual interfaces — an API, database, queue or cloud provider — rather than testing each piece in isolation with mocks.
1. Integration tests check components together (roles on VMs, API clients against test APIs).
2. Use lab environments.
3. Clean up after.
4. Slower — run in CI stages.
5. Catch interface issues.
components → integrated test → results
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
pytest -q <test-path>Primary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
component A → real contract/interface → dependency B → protocol result → durable state/read-back → cleanup → compatibility/failure evidence
Healthy evidence: real contract boundaries are exercised with versioned dependencies, isolated data and durable-state assertions.
Step 2 Command read-back and what it shows Verify boundary
pytest -q <test-path> is the bounded verification surface selected for Testing → Integration Testing. A known-good result is the intended component versions exchange the expected request/state and receive the correct response/side effects across the real boundary, including selected error cases, and repeated runs cleanly isolate test data. Treat schema/auth/protocol mismatch, missing side effects, incompatible version behavior or apparent success that depends on a permissive stub not representative of the real integration as broken/suspicious. pytest shows outcomes of the selected integration cases and their configured dependencies, but it does not show every downstream system or full end-to-end behavior.
Step 3 Failure modes and next checks Narrow the fault
Suspicious evidence: tests use shared mutable environments, assert only transport success or silently adapt to incompatible dependency behavior.
Integration Testing shows selected real component contracts under the test setup, but it does not show the complete user/workload path or every production dependency.
Step 4 Observation-driven branch and next-check logic Narrow the fault
For a failing Testing → Integration Testing case, freeze scope first: target/object, desired revision or request, and failure time. Inspect pytest -q <test-path>. Branch on evidence rather than labels: if setup cannot establish dependent services, fix environment before product interpretation; if request reaches dependency but contract/schema/status differs, inspect the shared interface; if interface succeeds but workflow fails later, move to the next integration boundary rather than changing the first component.
Step 5 Common mistakes Narrow the fault
- No integration tests against a lab.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Integration pass ≠ full end-to-end workflow passes.
- HTTP/API success ≠ downstream durable state correct.
- One dependency version works ≠ supported versions all work.
- Shared test dependency healthy ≠ test isolation guaranteed.
molecule test— Ansible role integration- Test against real APIs in lab — integration
- Contract tests for APIs — compatibility
ReferenceWhat it is1 section · depth on demand
Core model
Define the contract boundary, provision representative dependencies, use controlled credentials/data, execute the integration, assert both protocol result and durable state, then clean up without hiding evidence from failures.
ReferenceHow it works1 section · depth on demand
How it works
In Testing → Integration Testing, effective state is split across the contract between two or more real components, including request/response schemas, authentication, persistence/message semantics and failure handling at their shared boundary. Integration tests deliberately keep the interface between components real enough to validate serialization, protocol and state exchange while controlling unrelated dependencies; the useful evidence is at the shared boundary. Schema migrations, clocks, queues/databases, credentials, network and version compatibility are independent dependencies. This matters because unit tests can pass while components disagree on schema or semantics, and an integration test can pass against a stub that is less strict than the real dependency.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
Integration Testing owns real cross-component contract checks; API, database, queue and platform branches own their detailed semantics.
Method
Integration testing checks that automation works with real components — a real API, database, container or device image — rather than mocks.
1. Provision a disposable environment (containers, VMs, virtual network devices such as Containerlab/CML).
2. Load known test data into dependent systems (NetBox fixtures, test accounts).
3. Run the automation exactly as in production (same entry point and options).
4. Assert on the resulting state of the real components.
5. Run a second time to check idempotency.
6. Tear down the environment.
molecule test -s docker # Ansible role against containers
containerlab deploy -t lab.clab.yml && pytest tests/integration && containerlab destroy -t lab.clab.yml
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Testing > Integration Testing. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.pytest.org/en/stable/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Integration Testing testing proof-boundary map
Fast criteria/scope, execution and effective-outcome proof boundaries for Integration Testing.
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Scope / oracle | Requirement, case, expected result and exercised scope are explicit | A generic green status exists without a trustworthy oracle or coverage boundary |
| Fixture / environment | Data, dependencies and environment versions are reproducible | Shared state, floating versions or stale fixtures make results non-reproducible |
| Effective outcome | Authoritative state/read-back and service-relevant evidence match the expected result | Tool/test/validator success substitutes for effective target or workload proof |
| Limits / next action | Coverage limits, unknowns and failures drive the next narrower check | Unknown evidence becomes pass, retries hide failures or broad success is inferred from one check |