Skip to main content
Back to list
testingAdvanced4 часа 20 минут7 lessons

Pytest: Контракты и Production CI/CD

Contracts + CI/CD: защита от breaking changes и production-автоматизация тестов.

7 lessons 4 часа 20 минут
Pytest: Контракты и Production CI/CD

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

required

Level 3 course is mandatory. You must know: advanced fixtures, pytest-xdist, src layout, plugins.

Go to course

Pytest: Legacy Code and TDD

Recommended before this course. Provides context of working with real project and TDD practices.

Go to course

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.

#pytest#ci-cd#contract-testing#github-actions#docker#quality-gates#flaky-tests#production#consumer-driven-contracts
Pytest: Контракты и Production CI/CD — Learning Center — Potapov.me