Skip to content

Instantly share code, notes, and snippets.

@developer-guy
Created March 12, 2020 08:12
Show Gist options
  • Save developer-guy/573b85404478535bb3d10f7f8671e84b to your computer and use it in GitHub Desktop.
Save developer-guy/573b85404478535bb3d10f7f8671e84b to your computer and use it in GitHub Desktop.
package main
import (
http_helper "github.com/gruntwork-io/terratest/modules/http-helper"
"github.com/gruntwork-io/terratest/modules/terraform"
"testing"
"time"
)
func TestWebServer(t *testing.T) {
tfOptions := &terraform.Options{
TerraformDir: "./web-server",
}
defer terraform.Destroy(t, tfOptions)
terraform.InitAndApply(t, tfOptions)
tfOutput := terraform.Output(t, tfOptions, "url")
http_helper.HttpGetWithRetry(t, tfOutput, nil, 200, "Hello, World", 15, 1*time.Second)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment