Skip to content

Commit

Permalink
Group template test logs for web service testing (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenyu authored Aug 7, 2023
1 parent edf6748 commit d382b79
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions template-only-test/template_infra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func SetUpBuildRepository(t *testing.T, projectName string) {
}

func SetUpDevEnvironment(t *testing.T) {
fmt.Println("::group::Creating web service dev environment")
shell.RunCommand(t, shell.Command{
Command: "make",
Args: []string{"infra-configure-app-service", "APP_NAME=app", "ENVIRONMENT=dev"},
Expand All @@ -106,6 +107,7 @@ func SetUpDevEnvironment(t *testing.T) {
Env: map[string]string{"TF_CLI_ARGS_apply": fmt.Sprintf("-input=false -auto-approve -var=image_tag=%s", imageTag)},
WorkingDir: "../",
})
fmt.Println("::endgroup::")
}

func ValidateAccountBackend(t *testing.T, region string, projectName string) {
Expand Down Expand Up @@ -152,6 +154,8 @@ func ValidateBuildRepository(t *testing.T, projectName string) {
}

func ValidateDevEnvironment(t *testing.T) {
fmt.Println("::group::Validating ability to call web service endpoint")

// Wait for service to be stable
appName := "app"
environmentName := "dev"
Expand All @@ -170,6 +174,7 @@ func ValidateDevEnvironment(t *testing.T) {
http_helper.HttpGetWithRetryWithCustomValidation(t, serviceEndpoint, nil, 10, 3*time.Second, func(responseStatus int, responseBody string) bool {
return responseStatus == 200
})
fmt.Println("::endgroup::")
}

func TeardownAccount(t *testing.T) {
Expand Down

0 comments on commit d382b79

Please sign in to comment.