Skip to content

Commit e1061d7

Browse files
committed
attempt to output terraform verify info
1 parent 964b55c commit e1061d7

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/gotest.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ jobs:
4646
- name: Install gotestsum
4747
shell: bash
4848
run: go install gotest.tools/gotestsum@latest
49-
49+
- name: Verify terraform provider
50+
run: |
51+
TF_CLI_CONFIG_FILE=$HOME/.terraformrc go test ./... -run=Test_VerifyE2E/Validate -v
5052
- name: Run tests
5153
run: TF_CLI_CONFIG_FILE=$HOME/.terraformrc gotestsum ./...
File renamed without changes.

previewe2e_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ func Test_VerifyE2E(t *testing.T) {
5757
tfexecs := verify.InstallTerraforms(installCtx, t, versions...)
5858
cancel()
5959

60+
if len(tfexecs) > 0 {
61+
t.Run("Validate", func(t *testing.T) {
62+
running, err := tfexecs[0].WorkingDir(".")
63+
require.NoError(t, err, "creating working dir")
64+
valid, err := running.Validate(context.Background())
65+
require.NoError(t, err, "terraform validate")
66+
67+
d, _ := json.MarshalIndent(valid, "", " ")
68+
t.Logf("validate:\n%s", string(d))
69+
})
70+
}
71+
6072
dirFs := os.DirFS("testdata")
6173
entries, err := fs.ReadDir(dirFs, ".")
6274
require.NoError(t, err)

0 commit comments

Comments
 (0)