CI/CD Concepts
Where Tests Fit in a Pipeline
Reading8 min read
Where Tests Fit in a Pipeline
A CI/CD pipeline has multiple stages. Knowing where each test type belongs maximises feedback speed while maintaining confidence.
The Pipeline Stages
Code Push
↓
[Lint & Static Analysis] ← seconds
↓
[Unit Tests] ← 1–3 minutes
↓
[Build / Compile]
↓
[Integration Tests] ← 5–15 minutes
↓
[Deploy to Staging]
↓
[Smoke Tests] ← 2–5 minutes
↓
[Full E2E Regression] ← 15–60 minutes (nightly or on main)
↓
[Deploy to Production]
↓
[Production Smoke Tests]
The Key Principle: Fail Fast
Tests that run early must be fast and reliable. A slow, flaky test early in the pipeline defeats the purpose of CI — developers stop waiting for results and merge without confidence.
Rule of thumb:
- Anything before integration tests: < 5 minutes total
- PR pipeline: < 10 minutes total
- Nightly: can be longer (30–60 minutes)
Test Type → Pipeline Stage
| Test Type | Stage | Why |
|---|---|---|
| Static analysis / linting | Pre-commit or first CI step | Zero overhead, catches syntax and style issues |
| Unit tests | After lint, before build | Fast, no infrastructure dependencies |
| Component tests | After build | Slightly slower, test component boundaries |
| API integration tests | After deploy to test env | Require running service |
| E2E smoke tests | After deploy to staging | Verify critical paths |
| Full E2E regression | Main branch / nightly | Complete coverage, slower |
| Performance tests | Nightly | 10+ minute runs |
What QA Owns in the Pipeline
QA engineers typically own:
- The E2E test suite (what is tested and how it is structured)
- Test reporting (what shows up in CI summaries)
- Quality gates (which failures block deployment)
- Smoke tests for production deployment verification
Developers own unit tests. DevOps owns the pipeline infrastructure.
Q
Knowledge CheckA full E2E regression suite takes 45 minutes. Should it run on every PR?
Next Lesson
YAML Workflow Syntax Crash Course