INFRA-DEVOPS Contents

Testing Strategy: unit→integration→e2e

A pragmatic testing ladder (unit→integration→e2e) with ownership, flake control, and release gating in CI.

On this page

Testing Ladder

  • Unit: fast, deterministic, runs on every push.
  • Integration: real dependencies (db, queue) in CI.
  • E2E: minimal critical paths; expensive, run as a gate.

Release Gates

  • Unit must be green always.
  • Integration green for merge to main/release branch.
  • E2E green for production promotion (or canary gate).

Flake Control Runbook

# Principles:
# 1) Detect flakes (rerun signal)
# 2) Quarantine quickly (do not block all releases)
# 3) Fix with ownership and deadline

# Example: capture test timing to spot slow/flaky tests
pytest -q --durations=20 || true

Failure Modes

  • Too many E2E tests → slow pipeline, people bypass gates.
  • No ownership → flakes become permanent and trust collapses.