In this sublesson, you’re going to write and run automated infrastructure/deployment tests to verify that environments have been configured correctly. So, the same way you write automated tests for your application, you’ll write automated tests for your infrastructure and deployment. The difference is when the tests get run. With infrastructure and deployment tests, the test suite is run after the infrastructure has been instantiated. You can’t really run infrastructure tests in an atomic manner the way you might with application tests. That said, you can still apply a test-first practice to infrastructure tests. What we like to do at Stelligent is to write Cucumber features without the step definitions – in other words, without the execution. This way, we can describe how we’d like the infrastructure to behave and commit these Cucumber specifications to the version-control repository. Then, later we implement the step definitions. We tend to use Cucumber for this type of infrastructure acceptance testing, but there are many other test automation tools available including serverspec and Test Kitchen – to name a few. Also, some teams choose to use system monitoring tools and others will integrate the monitoring into the infrastructure as a way to automatically recover from system failures. You might do this CloudWatch, ELB and Auto Scaling in AWS to have a fully automated and resilient infrastructure architecture.
- You’ve gone through the steps of setting up a Jenkins server and its pipeline.
- Launch Jenkins
- Go to the run-infrastructure-tests-dsl job and go to Configure
- Go to https://github.com/stelligent/honolulu_answers/blob/master/pipeline/run-infrastructure-tests.sh
- Go to https://github.com/stelligent/honolulu_answers/blob/master/pipeline/features/deployment.feature
- View https://github.com/stelligent/honolulu_answers/blob/master/pipeline/features/stepdefs/