Terratest
github.com
2
Leaving SiteNav
External Link Disclaimer
You are about to visit github.com. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
Terratest is a Go library that makes it easier to write automated tests for your infrastructure code, developed by Gruntwork (founded by Yevgeniy Brikman and Josh Padnick). With over 7,900 stars as of 2026, Terratest provides a comprehensive set of tools for testing Terraform configurations, Packer templates, Docker images, Kubernetes manifests, and cloud infrastructure. The library follows a pattern of deploy, validate, and undeploy: tests deploy real infrastructure resources to actual cloud environments (AWS, GCP, Azure), run validations against the deployed infrastructure, and then clean up all resources at the end of the test. Key testing utilities include: Terraform helpers (terraform.InitAndApply for deploying, terraform.Destroy for cleanup, terraform.Output for reading Terraform outputs, terraform.OutputAll for all outputs, and support for workspace selection and variable passing), Packer helpers (packer.BuildArtifact for building images, with template validation and variable substitution), Docker helpers (docker.Build for local image builds, docker.Run for starting containers, docker.RunExitCode for checking exit codes, and docker.Copy for file operations), Kubernetes helpers (k8s.KubectlApply, k8s.WaitUntilDeploymentAvailable, k8s.GetServiceEndpoint), Helm helpers (helm.Install for deploying Helm charts), AWS helpers (aws.GetAcmCertificateArn, aws.GetS3BucketVersioning), HTTP testing helpers (http_helper.HttpGetWithRetry for polling endpoints with retries until they return expected status codes), shell command execution (shell.RunCommand for running arbitrary CLI tools and checking exit codes), random string generation (util.RandomString for unique resource naming to avoid collisions in shared environments), logger (logger.Log for structured test output), and retry logic (retry.DoWithRetry for handling eventual consistency in distributed systems).
Statistics
2
Views
0
Clicks
0
Like
0
Dislike