Skip to content

Commit

Permalink
make new config and state for each test
Browse files Browse the repository at this point in the history
  • Loading branch information
VenelinMartinov committed Jul 3, 2024
1 parent 725ea59 commit d8395ff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/tfbridge/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,19 @@ func diffTest(t *testing.T, tfs map[string]*v2Schema.Schema, inputs,
assert.Equal(t, expectedDiffChanges, changes)
assert.Equal(t, expectedDiff, diff)
})
})
}

for _, s := range setup {
t.Run(s.name, func(t *testing.T) {
sch, r, provider, info := s.setup(tfs)

tfState, err := makeTerraformStateWithOpts(ctx, r, "id", stateMap,
makeTerraformStateOptions{defaultZeroSchemaVersion: true})
assert.NoError(t, err)

config, _, err := MakeTerraformConfig(ctx, &Provider{tf: provider}, inputsMap, sch, info)
assert.NoError(t, err)
// Add an ignoreChanges entry for each path in the expected diff, then re-convert the diff
// and check the result.
t.Run("withIgnoreAllExpected", func(t *testing.T) {
Expand Down

0 comments on commit d8395ff

Please sign in to comment.