GuideIntermediate

Testing in CI/CD

Learn to run your test suite automatically on every change with continuous integration. This guide covers what a pipeline is, how to write your first GitHub Actions workflow that runs pytest on every push, how to reproduce a failure that only shows up in CI locally (the environment gap, pinned dependencies), the matrix of Python versions and operating systems, how to speed up the suite with dependency caching and parallelism (`pytest-xdist`), quality gates (coverage thresholds that break the build), and what to do with flaky tests that only fail in CI. It closes with a capstone project: build a complete CI pipeline for Reservo with a version matrix, a coverage gate, caching, and parallelism, delivering the YAML workflow along with the local-parity setup.

64
lessons
8
modules
English · Spanish
available in
Yes
certificate
Free
access
NIEVA

Outcomes

What you'll be able to do

  • Understand what a CI pipeline is and why "it works on my machine" isn't enough
  • Write your first GitHub Actions workflow that runs pytest on every push, and read its log
  • Reproduce a failure that only occurs in CI locally: pinned dependencies and deterministic installs
  • Configure the Python version and operating system matrix, and decide when it's worth it
  • Speed up the pipeline with dependency caching (`actions/cache`) and parallelism with `pytest-xdist`
  • Configure quality gates: a coverage threshold that breaks the build (`--cov-fail-under`)
  • Handle flaky tests in CI: the retry debate, quarantining, and why they erode trust in the pipeline
  • Build a complete CI pipeline for Reservo with a matrix, caching, parallelism, and a coverage gate as a capstone project

Before you start

What you need to bring

It's for you if...

  • Devs who already have a pytest test suite and want to run it automatically on every push
  • Teams struggling with slow or unstable (flaky) CI pipelines who want a reliable CI
  • Devs who want to learn GitHub Actions applied specifically to automated testing

Requirements and materials

  • An existing pytest test suite (or the Testing Fundamentals & TDD Guide completed)
  • A GitHub account and basic familiarity with git
  • Python 3.10+ and pip installed locally

Content

The syllabus, module by module

Open any of them to see its lessons.

Common questions

What people usually ask

Start whenever you like

Reviews

What students say

These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.

No approved reviews yet.

Be the first to share your experience!