Skip to content

Commit 493eef2

Browse files
committed
ensure test runs for future versions of terraform
runTestVersions should not be used where runTest and a version check would suffice. Each call to runTestVersions must be manually updated when new versions of Terraform are released, whereas runTest tests are run against all known relevant releases.
1 parent 039095f commit 493eef2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tfexec/internal/e2etest/providers_lock_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ import (
77
"github.com/hashicorp/go-version"
88

99
"github.com/hashicorp/terraform-exec/tfexec"
10-
"github.com/hashicorp/terraform-exec/tfexec/internal/testutil"
10+
)
11+
12+
var (
13+
providersLockMinVersion = version.Must(version.NewVersion("0.14.0"))
1114
)
1215

1316
func TestProvidersLock(t *testing.T) {
14-
runTestVersions(t, []string{testutil.Latest014, testutil.Latest015, testutil.Latest_v1}, "basic", func(t *testing.T, tfv *version.Version, tf *tfexec.Terraform) {
17+
runTest(t, "basic", func(t *testing.T, tfv *version.Version, tf *tfexec.Terraform) {
18+
if tfv.LessThan(providersLockMinVersion) {
19+
t.Skip("terraform providers lock was added in Terraform 0.14, so test is not valid")
20+
}
1521
err := tf.Init(context.Background())
1622
if err != nil {
1723
t.Fatalf("error running Init in test directory: %s", err)

0 commit comments

Comments
 (0)