Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Tame Your Test Environment With Docker Compose

DZone's Guide to

Tame Your Test Environment With Docker Compose

A recap from a presentation on how using Docker Compose helps manage service dependencies and run complicated test processes.

· DevOps Zone ·
Free Resource

In response to accelerated release cycles, a new set of testing capabilities is now required to deliver quality at speed. This is why there is a shake-up in the testing tools landscape—and a new leader has emerged in the just released Gartner Magic Quadrant for Software Test Automation.

I just gave a fun little presentation at the Docker meetup last night at the Heavybit clubhouse. The video of the talk should be online soon, but until then here’s a little recap of the content.

Kevin_Docker_Meetup

Docker Compose

Even if you don’t use Docker in production yet, Docker Compose can be super helpful in your dev and test environments. Docker Compose is basically a tool to run an arbitrary number of Docker containers at once, linked to each other and otherwise configured in whatever way is specified in a simple YAML file.

Service Dependencies

service dependencies

One use case for Docker Compose in your dev/test environments is managing service dependencies. If, for example, you need a LESS compiler, a linter, a DB, and an app server all running in your dev environment, you can manage them simply with a single docker-compose.yml. If you’re familiar with tools like Foreman to manage multiple processes in your dev environment, Docker Compose can do a very similar job, but far beyond starting each process, it runs each service in its own Docker container, which means all dependencies are very self-contained. Here’s a video example of one of the use cases I covered in my talk last night (there’s no sound in the video):

Complex Test Services

test services

In addition to managing your app’s complex service dependencies, Docker Compose can also lend a hand in running complicated test processes. Distributed stress tests or complex security scans come to mind, but even vanilla browser tests involve a fairly complicated set of intercommunicating processes that can be complex to set up and think about. Docker Compose helps provide some clear structure to this kind of setup as well as parity between dev and test/CI environments. Here’s another quick video demo of this (again, sound-free):

That’s pretty much the skinny on using Docker Compose for your dev and test environments, including CircleCI. All the code used in the videos above is available on GitHub:

The slides from the presentation are also available on SlideShare.

Thanks for reading! And don’t forget to check out the CircleCI docs on Docker to learn how to get up and running with CircleCI for all your docker needs!

Gartner: Digital Transformation, DevOps, and the Future of Testing. Download Now! 

Topics:
devops ,continuous integration ,docker ,docker compose ,testing

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}