Terratest is a Go library and testing framework designed for automating the deployment, validation, and destruction of infrastructure stacks. It serves as a cloud resource verification tool that interacts with provider APIs and executes remote shell commands to ensure infrastructure definitions are correctly configured.
The framework provides specialized support for validating Terraform modules and Kubernetes deployments, including the verification of container orchestration manifests and Helm charts. It distinguishes itself through the use of Docker container utilities for script execution and tool isolation, as well as the ability to verify the internal state of containers and remote systems via SSH.
The project covers a broad range of validation primitives, including deployment idempotency checks, HTTP endpoint verification with retry logic, and automated resource cleanup to prevent cost sprawl. It also handles operational concerns such as parallel test log de-interleaving, resource identifier namespacing to prevent collisions, and policy compliance auditing.
Terratest integrates with Maven builds and supports library version pinning to ensure reproducible test environments.