Menu Close

Testing Infrastructure

When doing integration testing, one of the pain points is how long it takes to get an environment set up.

Two parts:
 1. Creating it in the first place and the code to make it happen automatically

 2. Running the setup code each time you want to run the test.  Running it automatically, the test will still take a long time to run.

The first is a pain, although you have to do a lot of it regardless to create your production environment.

Can we avoid the second one?

I’m imagining a VM which has the database you need to set up prepopulated  and we take a snapshot of it.

To run the test, we copy the snapshot, run the copy, and the environment is ready for us to test against.

Seems simple when I describe it like this. Why have I not seen it done?  Has someone previously created a test system like this and I just haven’t noticed?

Could you do something like it in Docker, instead?