Over the years, I’ve learned one key lesson from my experience in automating test cases. Regardless of how much effort I put into making my test suites the most well-designed, high-quality work of software engineering, the fact remains that all these test cases are useless if I don’t have a test infrastructure to adequately support running them. In my experience test environment availability is very limited and I need to be able to work with minimal resources.
For example, on a recent project I was responsible for, I had a suite of REST API tests, which needed to be run continuously in a collection of environments that mirrored a variety of customer environment configurations (OS, database server, application server, browser).
I could have gone the traditional route of having a permanent environment in place for each environment configuration but this would have been very draining on the limited resources available to me. Also, in my case, my test suite was made up of API tests, which meant they executed relatively quickly (compared to say UI tests). To have multiple environments dedicated to running a short test cycle a few times a day seemed to me like a massive waste of resources.
To solve this problem, I looked into using Docker containers. This way I could configure, create and remove environments easily, quickly so as best to suit our own environmental requirements.
So in this talk, I would like to take the audience through my journey of how I used Docker and CI tools to overcome the challenges I had around lack of test infrastructure resources.
My talk will cover the following:
- How to create docker containers automatically when needed
- How to remove docker containers automatically when not needed anymore
- Several ways to create and remove docker containers
- Advantage of using Docker to create test environment
- Challenges involved with creating a test environment