Skip to content

Commit 88c71b7

Browse files
committed
test: Fix test and update override files to not include any experiment lists in the terraform block.
1 parent cac915f commit 88c71b7

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

internal/configs/parser_config_dir_test.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,11 @@ func TestParserLoadConfigDirSuccess(t *testing.T) {
3636
t.Run(name, func(t *testing.T) {
3737
parser := NewParser(nil)
3838

39-
var expectWarning bool
4039
if strings.Contains(name, "state-store") {
4140
// The PSS project is currently gated as experimental
4241
// TODO(SarahFrench/radeksimko) - remove this from the test once
4342
// the feature is GA.
4443
parser.allowExperiments = true
45-
46-
// While the feature is experimental a warning will always be returned
47-
// about the feature.
48-
expectWarning = true
4944
}
5045

5146
path := filepath.Join("testdata/valid-modules", name)
@@ -79,19 +74,13 @@ func TestParserLoadConfigDirSuccess(t *testing.T) {
7974
diags = filterDiags
8075
}
8176
if diags.HasErrors() {
82-
t.Errorf("unexpected error diagnostics")
77+
t.Error("unexpected error diagnostics")
8378
for _, diag := range diags.Errs() {
8479
t.Logf("- %s", diag)
8580
}
8681
}
87-
if !expectWarning && len(diags) != 0 {
88-
t.Errorf("unexpected diagnostics: expected no warnings")
89-
for _, diag := range diags {
90-
t.Logf("- %s", diag)
91-
}
92-
}
93-
if expectWarning && len(diags) != 1 {
94-
t.Errorf("unexpected diagnostics: expected a single warning")
82+
if len(diags) > 0 {
83+
t.Error("unexpected diagnostics:")
9584
for _, diag := range diags {
9685
t.Logf("- %s", diag)
9786
}

internal/configs/testdata/valid-modules/override-backend-with-state-store/override.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
terraform {
2+
# Not including an experiments list here
3+
# See https://github.com/hashicorp/terraform/issues/38012
24
required_providers {
35
foo = {
46
source = "my-org/foo"

internal/configs/testdata/valid-modules/override-cloud-with-state-store/override.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
terraform {
2+
# Not including an experiments list here
3+
# See https://github.com/hashicorp/terraform/issues/38012
24
required_providers {
35
foo = {
46
source = "my-org/foo"

internal/configs/testdata/valid-modules/override-state-store-no-base/override.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
terraform {
2-
experiments = [pluggable_state_stores]
2+
# Not including an experiments list here
3+
# See https://github.com/hashicorp/terraform/issues/38012
34
required_providers {
45
test = {
56
source = "hashicorp/test"

internal/configs/testdata/valid-modules/override-state-store/override.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
terraform {
2+
# Not including an experiments list here
3+
# See https://github.com/hashicorp/terraform/issues/38012
24
required_providers {
35
bar = {
46
source = "my-org/bar"

0 commit comments

Comments
 (0)