Skip to content

Commit 31daa06

Browse files
committed
Stop gating the inMem state store behind TF_ACC in the simple6 provider
This provider is not accessible to users so it's unnecessary.
1 parent 11a388d commit 31daa06

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

internal/command/e2etest/primary_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func TestPrimaryChdirOption(t *testing.T) {
233233
}
234234
}
235235

236-
// Requires TF_TEST_EXPERIMENT and TF_ACC to be set in the environment
236+
// Requires TF_TEST_EXPERIMENT to be set in the environment
237237
func TestPrimary_stateStore(t *testing.T) {
238238
if !canRunGoBuild {
239239
// We're running in a separate-build-then-run context, so we can't

internal/provider-simple-v6/provider.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"errors"
1010
"fmt"
1111
"log"
12-
"os"
1312
"time"
1413

1514
"github.com/zclconf/go-cty/cty"
@@ -108,8 +107,10 @@ func provider() simple {
108107
},
109108
},
110109
},
111-
Actions: map[string]providers.ActionSchema{},
112-
StateStores: map[string]providers.Schema{},
110+
Actions: map[string]providers.ActionSchema{},
111+
StateStores: map[string]providers.Schema{
112+
inMemStoreName: stateStoreInMemGetSchema(),
113+
},
113114
ServerCapabilities: providers.ServerCapabilities{
114115
PlanDestroy: true,
115116
GetProviderSchemaOptional: true,
@@ -136,12 +137,6 @@ func provider() simple {
136137
inMem: &InMemStoreSingle{}, // default workspace doesn't exist by default here; needs explicit creation via init command
137138
}
138139

139-
// Only include the inmem state store in the provider when `TF_ACC` is set in the environment
140-
// Excluding this from the schemas is sufficient to block usage.
141-
if v := os.Getenv("TF_ACC"); v != "" {
142-
provider.schema.StateStores[inMemStoreName] = stateStoreInMemGetSchema()
143-
}
144-
145140
return provider
146141
}
147142

internal/provider-simple-v6/state_store_inmem_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import (
1515
)
1616

1717
func TestBackendLocked(t *testing.T) {
18-
t.Setenv("TF_ACC", "1") // enable using the inmem state store
19-
2018
// backend.TestBackendStateLocks assumes the default workspace exists
2119
// by default, so we need to make it exist using the method below.
2220
provider := ProviderWithDefaultWorkspace()
@@ -37,8 +35,6 @@ func TestBackendLocked(t *testing.T) {
3735
}
3836

3937
func TestRemoteState(t *testing.T) {
40-
t.Setenv("TF_ACC", "1") // enable using the inmem state store
41-
4238
provider := Provider()
4339

4440
plug, err := pluggable.NewPluggable(provider, inMemStoreName)

0 commit comments

Comments
 (0)