Skip to content

Commit f68bff0

Browse files
Refactor sdkv2 detailed diff tests (#2816)
This PR refactors the SDKv2 detailed diff tests to make test sharding easier. The main problem was that TestDetailedDiffSet was too large. Very similar to what #2814 does for PF. This PR: - Moves the SDKv2 detailed diff tests to their own folder. This should make sharing code between them easier without exposing it to the other tests. - Splits up `TestDetailedDiffSet` into a few separate tests. This will allow the tests to be run on different shards. - Moves around some of the shared code into the `value_makers.go` file, instead of duplicating in each test. - Renames the tests to specify that they are for SDKv2 and renamed some of the utility functions to clarify what they do. [2c18440](2c18440) has test recordings, the rest are the changes. The test recording changes are all no-ops related to the change in the struct being recorded.
1 parent 7bfd76b commit f68bff0

File tree

1,016 files changed

+1510
-3050
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,016 files changed

+1510
-3050
lines changed

pkg/tests/detailed_diff_list_test.go renamed to pkg/tests/diff_test/detailed_diff_list_test.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
crosstests "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/internal/tests/cross-tests"
1212
)
1313

14-
func TestDetailedDiffList(t *testing.T) {
14+
func TestSDKv2DetailedDiffList(t *testing.T) {
1515
t.Parallel()
1616

1717
listAttrSchema := schema.Resource{
@@ -297,14 +297,6 @@ func TestDetailedDiffList(t *testing.T) {
297297

298298
scenarios := append(oneElementScenarios, multiElementScenarios...)
299299

300-
type testOutput struct {
301-
initialValue *[]string
302-
changeValue *[]string
303-
tfOut string
304-
pulumiOut string
305-
detailedDiff map[string]any
306-
}
307-
308300
runTest := func(t *testing.T, schema schema.Resource, valueMaker func(*[]string) map[string]cty.Value, initialValue *[]string, changeValue *[]string) {
309301
diff := crosstests.Diff(t, &schema, valueMaker(initialValue), valueMaker(changeValue))
310302
autogold.ExpectFile(t, testOutput{

0 commit comments

Comments
 (0)