Skip to content

Commit

Permalink
Attempt to log the error
Browse files Browse the repository at this point in the history
  • Loading branch information
romanini-ciandt committed Oct 24, 2024
1 parent 24c7aae commit 09c06e6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/integration/oss-apache-web-server/apache_web_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,27 @@ import (
"fmt"
"testing"

"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/gcloud"
"github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test/pkg/tft"
"github.com/gruntwork-io/terratest/modules/shell"
"github.com/stretchr/testify/assert"
)

func TestFakeApacheWebServerModule(t *testing.T) {
apacheT := tft.NewTFBlueprintTest(t)
projectId := apacheT.GetTFSetupJsonOutput("project_id")

apacheT.DefineApply(func(assert *assert.Assertions) {
apacheT.DefaultApply(assert)
t.Cleanup(func() {
logsCmd := fmt.Sprintf("logging read --project=%s", projectId.Str)
logs := gcloud.Runf(t, logsCmd).Array()
for _, log := range logs {
t.Logf("%s build-log: %s", projectId.Str, log.Get("textPayload").String())
}
})
})

apacheT.DefineVerify(func(assert *assert.Assertions) {
apacheT.DefaultVerify(assert)

Expand Down

0 comments on commit 09c06e6

Please sign in to comment.