From fab7d4ef112cb9f2efce2e76c7b05475f04fdc89 Mon Sep 17 00:00:00 2001 From: jonathancarvalheiro <57483006+jonathancarvalheiro@users.noreply.github.com> Date: Tue, 30 Mar 2021 17:16:17 +0100 Subject: [PATCH] Fixing the parsing url error When I run this test I got this error: retry.go:84: HTTP GET to URL "https://dummy.us-east-2.amazonaws.com/live" returned an error: parse "\"https://dummy.us-east-2.amazonaws.com/live\"": first path segment in URL cannot contain colon. Sleeping for 3s and will try again. The propose change fix it --- test/hello_world_app_unit_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/hello_world_app_unit_test.go b/test/hello_world_app_unit_test.go index b34f767..82f70de 100644 --- a/test/hello_world_app_unit_test.go +++ b/test/hello_world_app_unit_test.go @@ -7,6 +7,7 @@ import ( "github.com/gruntwork-io/terratest/modules/terraform" "testing" "time" + "strings" ) // An example of a unit test for the Terraform module in examples/hello-world-app @@ -40,6 +41,7 @@ func TestHelloWorldAppUnit(t *testing.T) { func validateHelloWorldApp(t *testing.T, terraformOptions *terraform.Options) { // Run `terraform output` to get the values of output variables url := terraform.Output(t, terraformOptions, "url") + url = strings.Replace(url, "\"","",-1) // Verify the app returns a 200 OK with the text "Hello, World!" expectedStatus := 200