Integration Testing in CI with Docker Compose
Intermediate · 40 minutes · 100 points
Learn how to set up and run integration tests using Docker Compose in a CI pipeline. You will install Docker Compose, write a multi-service Compose file with an application and a database, create integration test scripts, and simulate a CI pipeline run that validates your services work together end-to-end.
What you’ll learn
- Install Docker Compose CLI and understand its role in CI pipelines
- Write a multi-service docker-compose.yml with a web app and database dependency
- Create integration test scripts that validate service health and inter-service communication
- Simulate a complete CI pipeline run using a shell script that brings up services, runs tests, and tears down
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 4 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: ubuntu:22.04
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- Basic understanding of Docker containers
- Familiarity with YAML syntax
- Basic shell scripting knowledge
Topics: docker-compose, ci-cd, integration-testing, pipeline, junit, healthcheck, multi-service, testing, devops, shell-scripting
Create a free account to start this lab.