Pytest: Контракты и Production CI/CD
Contracts + CI/CD: защита от breaking changes и production-автоматизация тестов.

What you'll learn
Production-готовность тестов: от контрактного тестирования до полноценного CI/CD. Настраиваем Consumer-Driven Contracts для защиты от breaking changes между Frontend и Backend. Строим production CI/CD в GitHub Actions: параллельный запуск, шардирование, flaky tests detection, quality gates, matrix strategy. 4.5 часа практики с полным .github/workflows/test.yml для копирования в свой проект.
Contract Testing: protection from breaking changes
Consumer-Driven Contracts for API between Frontend and Backend. Pact or JSON Schema. Catch breaking changes before production on Todo app example.
Production CI/CD: from 10 minutes to 2 minutes
GitHub Actions: parallel execution, test sharding, Docker image caching. Matrix strategy for Python 3.10/3.11/3.12 and PostgreSQL 14/15/16. Full production-ready workflow.
Quality Gates: automatic main protection
Coverage thresholds, flaky tests detection and quarantine, performance regression, security scanning. Branch protection rules. Stop bad PRs automatically.
Testimonials
alumni“If you can't deploy your software to production on demand, you're not doing Continuous Delivery.”
Martin Fowler
“The key to fast flow is small batch sizes and parallel execution.”
Jez Humble (Continuous Delivery)
“Consumer-Driven Contracts are a technique for evolving services in a service-oriented architecture without breaking existing consumers.”
Ian Robinson (Consumer-Driven Contracts)
What's inside
Contract Testing: Consumer-Driven Contracts, Pact or JSON Schema for API between Frontend and Backend
Contracts Practice: Todo app API, catch breaking changes before production
GitHub Actions production: parallel execution, sharding, Docker image caching
Flaky Tests Detection: automatic detection and quarantine of unstable tests
Quality Gates: coverage thresholds, performance regression, security scanning
Matrix Strategy: testing on different Python (3.10/3.11/3.12) and PostgreSQL (14/15/16) versions
Full .github/workflows/test.yml: ready production CI/CD for copying to your project
Prerequisites
Pytest: Professional Tools
requiredLevel 3 course is mandatory. You must know: advanced fixtures, pytest-xdist, src layout, plugins.
Go to coursePytest: Legacy Code and TDD
Recommended before this course. Provides context of working with real project and TDD practices.
Go to courseCourse curriculum
Contract Testing: Consumer-Driven Contracts
40 минут
Практика: Контракты для Todo API
40 минут
CI/CD: Параллельный запуск и шардирование
50 минут
CI/CD: Автоматическая детекция Flaky Tests
40 минут
CI/CD: Quality Gates и защита main
50 минут
CI/CD: Matrix Strategy для разных версий
40 минут
Финал: Полный Production CI/CD проект
60 минут
FAQ
Do I need to take 'Legacy Code and TDD' course?
Not required, but recommended. It provides context of working with real project (Todo app). This course focuses on CI/CD and contracts, not test development.
I use GitLab CI, not GitHub Actions. Is course useful?
Yes! Concepts (parallel execution, sharding, quality gates, flaky detection) are universal. GitHub Actions syntax easily adapts to GitLab CI, Jenkins, CircleCI and others.
I don't have contracts with Frontend. Is course relevant?
Even if not using contracts now, CI/CD part of course (4+ hours) fully applicable. Contracts are bonus for teams with microservices or APIs for clients.
What should I do after this course?
Implement in your project: set up production CI/CD, add quality gates, optimize run time. If working with async—move to 'Async Race Conditions' course.
Related Materials
These materials complement the course but are not part of it. Study at your own pace.
DB Testing with PostgreSQL
If working with DB in CI/CD: Alembic, factory_boy, Testcontainers. Recommended for DB setup in GitHub Actions.
Pytest: Async Race Conditions
Specialization for async developers. Can take in parallel with this course if working with asyncio in CI/CD.
Pytest: Legacy Code and TDD
Previous course in series. If not taken yet—recommended for understanding project context.