Testing code that builds an entire infrastructure is a different proposition altogether. Not only do we need sophisticated libraries of code to verify the intended behavior of our systems, we need to be able to build and install the systems themselves. Consider the following test:
Scenario: Bluepill restarts Unicorn Given I have a newly installed Ubuntu machine managed by Chef And I apply the Unicorn role And I apply the Bluepill role And the Unicorn service is running When I kill the Unicorn process Then within 2 seconds the Unicorn process should be running again
To test this manually, we would need to find a machine, install Ubuntu on it, bootstrap it with Chef, apply the role, run Chef, log onto the machine, check that Unicorn is running, kill Unicorn, then finally check that it has restarted. This would be tremendously time-consuming, and expensive—so much so that ...