Saturday, March 30, 2019

Built for Speed: a #30DaysOfTesting Testability #T9y Entry

Is anyone else excited about the fact that the Stray Cats are touring this year? Just me? Feels really strange to see how old some of my heroes and contemporaries in the music world are. That means that I must be... (shakes head vigorously)... oh no, we're not going down that road right now. NOPE!!!

So, more "30 Days of Testability"? Fantastic!

How long does it take to set up a new test environment and start testing. Could this be faster?

This is a passion project for me as I have been actively working on a way to speed this up for years. We deploy our software to a cloud-based server(s) (depending on the configuration it can be several) and for that purpose, I prefer testing with a device(s) that matches that environment. In our world, we call these installations and configurations "appliances" so when I talk about an install, an appliance could mean a single machine or multiple machines connected together to form a single instance. The most common is an all in one appliance, meaning a single machine with everything on it.

I have a project that I have worked on for a couple of years now that has built up on all of the things that I normally do to set up a system for testing. For any software tester that wants to get some "code credit in the source repo, this is actually a really good project to start with. Much depends on the system you are working with but if you are developing and deploying a Linux based application, there is a huge amount that can be done with native shell scripts. Tasks such as:

- setting up host details for environments,
- provisioning them for DNS
- setting up security policies
- configuring networking and ports
- downloading necessary libraries and dependencies
- standard installation and configuration commands for an application
- setting up primary databases and populating them with starter data

all of these can be readily set up and controlled with standard shell scripts. With a typical appliance setup, there are three stages:

- machine setup and provisioning so it can respond on the network
- basic installation of the application
- post-installation steps that are heavy on configuring the appliance and importing starter and test data

One of the nicer things to be able to talk about at standup or retrospectives is when someone mentions an item to make part of installation or setup and often I can just say "oh, grab the appliance setup repo, I have that taken care of" or "hey, that is a good idea, let me drop that into the appliance setup repo".

The speed of setup is something I'm a little bit obsessed with. I frequently run timing commands so I can see how long a given area takes to set up and configure and my evergreen question is "OK, am I doing this in an efficient enough way? How can I shave some time off here or there?" It's also fun when someone asks "hey, how long will it take to get a test environment set up?" and I can give them an answer to within forty-five seconds, give or take ;).

Could I make setup faster with containers or other tools? I certainly can but since we are not at this point deploying containers for customers, that's a question for another time :).

No comments: