From 2a2857c3cbe822a1364f6234776f77bfc14bc2ea Mon Sep 17 00:00:00 2001 From: Andrew Peabody Date: Wed, 8 May 2024 19:03:53 -0700 Subject: [PATCH] feat(tft): log TF version (#2323) --- infra/blueprint-test/pkg/tft/terraform.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/infra/blueprint-test/pkg/tft/terraform.go b/infra/blueprint-test/pkg/tft/terraform.go index 23f26a7917f..0cbf3145083 100644 --- a/infra/blueprint-test/pkg/tft/terraform.go +++ b/infra/blueprint-test/pkg/tft/terraform.go @@ -36,6 +36,7 @@ import ( "github.com/hashicorp/terraform-config-inspect/tfconfig" "github.com/mitchellh/go-testing-interface" "github.com/stretchr/testify/assert" + "github.com/tidwall/gjson" ) const ( @@ -259,7 +260,8 @@ func NewTFBlueprintTest(t testing.TB, opts ...tftOption) *TFBlueprintTest { tft.setupOutputOverrides[k] = v } - tft.logger.Logf(tft.t, "Running tests TF configs in %s", tft.tfDir) + tftVersion := gjson.Get(terraform.RunTerraformCommand(tft.t, tft.GetTFOptions(), "version", "-json"), "terraform_version") + tft.logger.Logf(tft.t, "Running tests TF configs in %s with version %s", tft.tfDir, tftVersion) return tft }