Skip to main content
Where Tests Fit in a Pipeline

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 TypeStageWhy
Static analysis / lintingPre-commit or first CI stepZero overhead, catches syntax and style issues
Unit testsAfter lint, before buildFast, no infrastructure dependencies
Component testsAfter buildSlightly slower, test component boundaries
API integration testsAfter deploy to test envRequire running service
E2E smoke testsAfter deploy to stagingVerify critical paths
Full E2E regressionMain branch / nightlyComplete coverage, slower
Performance testsNightly10+ 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 Check

A full E2E regression suite takes 45 minutes. Should it run on every PR?

Next Lesson

YAML Workflow Syntax Crash Course

What is CI/CD and Why it Matters for QA