CI/CD and Automated Testing
Build pipelines that test every change and release it safely: pytest suites with fixtures and coverage, GitHub Actions and Jenkins pipelines, quality gates, and deployment strategies that make releases routine.
Intermediate · Cloud & DevOps · about 17 hours · 5 modules · certificate on completion
Taught by Rodrigoò Silvà, Agnieszka Kowalskà, AI Learning Companions.
About this course
Teams that release often and calmly have one thing in common: every change goes through an automated pipeline that builds it, tests it and deploys it the same way every time. This course teaches you to build that pipeline. You'll start with the principles, continuous integration, delivery and deployment, version control as the foundation and the deployment strategies that make releases safe, then write pipelines as code in GitHub Actions and Jenkins, with secrets handled properly. You'll design a test strategy across the testing pyramid, write pytest suites with fixtures, parametrisation, mocks and markers, and measure what they cover. Finally you'll turn the tests into quality gates, publish reports and artefacts, hunt down a flaky test, and deploy only when everything is green.
All the labs use stockroom, a small inventory library and command-line tool that comes with the course, and build on each other: a local CI loop, a first workflow, tests at every level of the pyramid, a coverage gate, and a full pipeline with a simulated deployment. Every workflow is checked with actionlint and every command shows the output a correct solution prints. The capstone is a complete, protected pipeline with a tagged release.
What you'll learn
- Explain how continuous integration, delivery and deployment shorten feedback and lower the risk of each release
- Build GitHub Actions workflows and Jenkins pipelines that lint, test, build and deploy, with secrets handled safely
- Design a test strategy across unit, integration and end-to-end tests, guided by the testing pyramid
- Write maintainable pytest suites with fixtures, parametrisation, markers, mocks and coverage
- Turn tests into quality gates that block bad changes, publish reports and keep flaky tests out of the pipeline
- Release with confidence using versioned artefacts, protected environments and strategies such as rolling, blue-green and canary
Skills you'll gain
Continuous integration, Continuous delivery and deployment, GitHub Actions, Jenkins pipelines, pytest, Test strategy, Code coverage, Quality gates, Secrets management, Deployment strategies
Tools
GitHub Actions, Jenkins, pytest, pytest-cov, Ruff, Git, actionlint
Before you start
Python Scripting and Linux for DevOps, or the same skills: comfortable Python (functions, classes, modules, virtual environments) and a Linux or macOS terminal. Basic Git (commit, branch, push, pull request), as in Git and GitHub Workflows for Teams. You need Python 3.11 or later, Git, and a free GitHub account with a public repository for the pipeline labs; a Jenkins server is optional.
Modules
Principles of CI/CD
Why teams integrate small changes continuously and keep software always ready to release: fast feedback, pipelines as code, version control as the foundation, and deployment strategies that make releases safe to repeat.
- What CI and CD are, and why they pay off (12 min)
- Version control: the foundation of the pipeline (12 min)
- Deployment strategies and release safety (13 min)
- Hands-on lab: Set up stockroom and a local CI loop
Building Pipelines (Jenkins/GitHub Actions)
Pipelines as code in the two tools teams use most: GitHub Actions workflows triggered by repository events, and Jenkins declarative pipelines. Stages from build to deploy, and secrets handled so they never leak.
- GitHub Actions workflows (13 min)
- Jenkins pipelines as code (12 min)
- Pipeline stages and secrets (12 min)
- Hands-on lab: Your first GitHub Actions workflow
Automated Testing Strategies
A testing strategy that gives fast, trustworthy feedback: the testing pyramid, unit tests with test doubles, integration tests against real dependencies, and a few end-to-end tests of the journeys that matter.
- The testing pyramid (12 min)
- Unit tests and test doubles (12 min)
- Integration and end-to-end tests (12 min)
- Hands-on lab: Test across the pyramid
Pytest in Practice
pytest the way professional suites use it: discovery and selection, fixtures for set-up and tear-down, parametrised tests, markers, plugins, and coverage that shows what the tests never touch.
- Assertions, discovery and running tests (12 min)
- Fixtures: set-up and tear-down (13 min)
- Parametrisation, markers and plugins (12 min)
- Hands-on lab: Fixtures, parametrisation and coverage
Integrating Tests into Pipelines
Make the tests count: quality gates that stop a bad change, reports and artefacts the pipeline publishes, flaky tests found and fixed, and a deployment that runs only when everything is green.
- Quality gates (12 min)
- Reports, artefacts and job summaries (12 min)
- Flaky tests and pipeline health (11 min)
- From a green build to a release (12 min)
- Hands-on lab: Quality gates, reports and a simulated deployment
Project: A complete CI/CD pipeline for stockroom
Take stockroom to a pipeline you would trust with a real product. First add a feature test-first: a restock command that adds stock to a product and reports whether it's still below its reorder level, with unit, integration and end-to-end tests. Then finish the pipeline in GitHub Actions. It must run on every pull request and on every push to main; lint and check formatting; run the unit and integration tests on several Python versions and the end-to-end tests on one; generate a coverage report and fail below 90%; keep the JUnit and coverage reports as artifacts even when tests fail; build the wheel once; and, only for pushes to main after every check has passed, deploy that same wheel to a staging environment protected by a required reviewer, with a smoke test. Pushing a version tag must create a GitHub release with the built files. Protect main with a ruleset that requires the checks, and write a Jenkinsfile with the same stages for a team that uses Jenkins.
Part of
- MLOps Engineer Professional Certificate
- DevOps and Cloud Engineer Professional Certificate
- API Engineering with Python Specialization
The products this course names are trademarks of their owners, who haven't made or endorsed it.