Gruntwork announced the Apache 2.0 open-source release of their Terratest infrastructure code testing utility at the end of last month, providing developers with a flexible tool for automating tests in their infrastructure-as-code initiatives. Gruntwork cofounder Yevgeniy Brikman hopes this new tool will alleviate an industry-wide fear that an incorrect change in an infrastructure codebase might have catastrophic results.

“Most IaC tools are immature, modern architectures are complicated, and seemingly minor changes to infrastructure code sometimes cause severe bugs, such as wiping out a server, a database, or even an entire data center,” Brikman wrote in a development blog post.

Originally an internal utility for maintaining Gruntwork’s own Infrastructure as Code Library, which hundreds of businesses rely on for ready-made infrastructure code, Terratest is a Go library that makes it easier to write automated tests for, as listed on the project’s GitHub:

  • Testing Terraform code
  • Testing Packer templates
  • Testing Docker images
  • Executing commands on servers over SSH
  • Working with AWS APIs
  • Making HTTP requests
  • Running shell commands
  • And much more

“I won’t claim that writing these tests is actually easy—it’s takes a considerable amount of work to get them just right—but it’s worth the effort, because these tests can run after every commit and verify that the code works as expected, thereby giving you the confidence to make the code changes you need,” Brikman wrote.

A breakdown of how to use the library along with copious examples can be found in the blog post and on the GitHub repository.

Top 5 projects trending on GitHub this week:

  1. Architect awesome: A backend architecture technical map
  2. Gvisor: Container runtime sandbox
  3. Protonnative: a React environment for cross-platform native desktop apps
  4. Gh-ost: GitHub’s Online Schema Migrations for MySQL
  5. ELF: a platform for game research