diff --git a/tfexec/graph.go b/tfexec/graph.go index 1b28aa57..0f8b0eee 100644 --- a/tfexec/graph.go +++ b/tfexec/graph.go @@ -60,7 +60,7 @@ func (tf *Terraform) graphCmd(ctx context.Context, opts ...GraphOption) (*exec.C args := []string{"graph"} if c.plan != "" { - // plan was a positional arguement prior to Terraform 0.15.0. Ensure proper use by checking version. + // plan was a positional argument prior to Terraform 0.15.0. Ensure proper use by checking version. if err := tf.compatible(ctx, tf0_15_0, nil); err == nil { args = append(args, "-plan="+c.plan) } else { diff --git a/tfexec/internal/e2etest/graph_test.go b/tfexec/internal/e2etest/graph_test.go index 715e189d..aea432f5 100644 --- a/tfexec/internal/e2etest/graph_test.go +++ b/tfexec/internal/e2etest/graph_test.go @@ -96,8 +96,9 @@ func expectedGraphOutput(tfv *version.Version) string { ` } - // 1.1.0+ - return `digraph { + if v.GreaterThanOrEqual(v1_1) && v.LessThan(v1_7) { + // 1.1.0 - 1.7.0 + return `digraph { compound = "true" newrank = "true" subgraph "root" { @@ -109,5 +110,14 @@ func expectedGraphOutput(tfv *version.Version) string { } } +` + } + + // 1.7.0+ + return `digraph G { + rankdir = "RL"; + node [shape = rect, fontname = "sans-serif"]; + "null_resource.foo" [label="null_resource.foo"]; +} ` } diff --git a/tfexec/internal/e2etest/providers_schema_test.go b/tfexec/internal/e2etest/providers_schema_test.go index 97979fc3..cafce807 100644 --- a/tfexec/internal/e2etest/providers_schema_test.go +++ b/tfexec/internal/e2etest/providers_schema_test.go @@ -22,6 +22,7 @@ var ( v0_15_0 = version.Must(version.NewVersion("0.15.0")) v1_0 = version.Must(version.NewVersion("1.0.0")) v1_1 = version.Must(version.NewVersion("1.1.0")) + v1_7 = version.Must(version.NewVersion("1.7.0")) ) func TestProvidersSchema(t *testing.T) {