diff --git a/test/integration/oss-apache-web-server/apache_web_server_test.go b/test/integration/oss-apache-web-server/apache_web_server_test.go index 341ff5d9..abca623e 100644 --- a/test/integration/oss-apache-web-server/apache_web_server_test.go +++ b/test/integration/oss-apache-web-server/apache_web_server_test.go @@ -18,6 +18,7 @@ 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" @@ -25,6 +26,19 @@ import ( 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)