github.com/darmach/terratest@v0.34.8-0.20210517103231-80931f95e3ff/docs/_docs/02_testing-best-practices/testing-environment.md (about) 1 --- 2 layout: collection-browser-doc 3 title: Testing environment 4 category: testing-best-practices 5 excerpt: >- 6 Learn more about testing environments. 7 tags: ["testing-best-practices"] 8 order: 202 9 nav_title: Documentation 10 nav_title_link: /docs/ 11 --- 12 13 Since most automated tests written with Terratest can make potentially destructive changes in your environment, we 14 strongly recommend running tests in an environment that is totally separate from production. For example, if you are 15 testing infrastructure code for AWS, you should run your tests in a completely separate AWS account. 16 17 This means that you will have to write your infrastructure code in such a way that you can plug in ([dependency 18 injection](https://en.wikipedia.org/wiki/Dependency_injection)) environment-specific details, such as account IDs, 19 domain names, IP addresses, etc. Adding support for this will typically make your code cleaner and more flexible.