Skip to content

Commit cca33d6

Browse files
committed
Add locks to test
1 parent 394d0b6 commit cca33d6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

internal/command/meta_backend_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,11 +2234,27 @@ func TestMetaBackend_reconfigureStateStoreChange(t *testing.T) {
22342234
return mock, nil
22352235
}
22362236

2237+
// Create locks - these would normally be the locks derived from config
2238+
locks := depsfile.NewLocks()
2239+
constraint, err := providerreqs.ParseVersionConstraints(">9.0.0")
2240+
if err != nil {
2241+
t.Fatalf("test setup failed when making constraint: %s", err)
2242+
}
2243+
expectedVersionString := "9.9.9"
2244+
expectedProviderSource := "registry.terraform.io/my-org/foo"
2245+
locks.SetProvider(
2246+
addrs.MustParseProviderSourceString(expectedProviderSource),
2247+
versions.MustParseVersion(expectedVersionString),
2248+
constraint,
2249+
[]providerreqs.Hash{"h1:foo"},
2250+
)
2251+
22372252
// Get the operations backend
22382253
_, beDiags := m.Backend(&BackendOpts{
22392254
Init: true,
22402255
StateStoreConfig: mod.StateStore,
22412256
ProviderFactory: factory,
2257+
Locks: locks,
22422258
})
22432259

22442260
if !beDiags.HasErrors() {

0 commit comments

Comments
 (0)