Skip to content

Commit

Permalink
Add detailed diff recordings to PF diff tests (#2657)
Browse files Browse the repository at this point in the history
This change adds recordings of the detailed diff sent to the engine to
all Diff cross-tests in PF. This helps with spot-checking the results
and troubleshooting issues.

This comes after
#2629 in order to
reduce the noise in the change there.
  • Loading branch information
VenelinMartinov authored Nov 26, 2024
1 parent 9319c4b commit d7eacfb
Show file tree
Hide file tree
Showing 326 changed files with 620 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/pf/tests/diff_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ func TestDetailedDiffList(t *testing.T) {
changeValue *[]string
tfOut string
pulumiOut string
detailedDiff map[string]any
}

for _, schemaValueMakerPair := range schemaValueMakerPairs {
Expand All @@ -242,6 +243,7 @@ func TestDetailedDiffList(t *testing.T) {
changeValue: scenario.changeValue,
tfOut: diff.TFOut,
pulumiOut: diff.PulumiOut,
detailedDiff: diff.PulumiDiff.DetailedDiff,
})
})
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/pf/tests/diff_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ func TestDetailedDiffMap(t *testing.T) {
changeValue *map[string]*string
tfOut string
pulumiOut string
detailedDiff map[string]any
}

for _, schemaValueMakerPair := range schemaValueMakerPairs {
Expand All @@ -184,6 +185,7 @@ func TestDetailedDiffMap(t *testing.T) {
changeValue: scenario.changeValue,
tfOut: diff.TFOut,
pulumiOut: diff.PulumiOut,
detailedDiff: diff.PulumiDiff.DetailedDiff,
})
})
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/pf/tests/diff_object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ func TestDetailedDiffObject(t *testing.T) {
changeValue *map[string]string
tfOut string
pulumiOut string
detailedDiff map[string]any
}

for _, schema := range schemas {
Expand All @@ -342,6 +343,7 @@ func TestDetailedDiffObject(t *testing.T) {
changeValue: scenario.changeValue,
tfOut: diff.TFOut,
pulumiOut: diff.PulumiOut,
detailedDiff: diff.PulumiDiff.DetailedDiff,
})
})
}
Expand All @@ -361,6 +363,7 @@ func TestDetailedDiffObject(t *testing.T) {
changeValue: scenario.changeValue,
tfOut: diff.TFOut,
pulumiOut: diff.PulumiOut,
detailedDiff: diff.PulumiDiff.DetailedDiff,
})
})
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/pf/tests/diff_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ func TestDetailedDiffSet(t *testing.T) {
changeValue *[]string
tfOut string
pulumiOut string
detailedDiff map[string]any
}

for _, schemaValueMakerPair := range schemaValueMakerPairs {
Expand All @@ -601,6 +602,7 @@ func TestDetailedDiffSet(t *testing.T) {
changeValue: scenario.changeValue,
tfOut: diff.TFOut,
pulumiOut: diff.PulumiOut,
detailedDiff: diff.PulumiDiff.DetailedDiff,
})
})
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/pf/tests/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func TestDetailedDiffStringAttribute(t *testing.T) {
changeValue *string
tfOut string
pulumiOut string
detailedDiff map[string]any
}

for _, schema := range schemas {
Expand All @@ -201,6 +202,7 @@ func TestDetailedDiffStringAttribute(t *testing.T) {
changeValue: scenario.changeValue,
tfOut: diff.TFOut,
pulumiOut: diff.PulumiOut,
detailedDiff: diff.PulumiDiff.DetailedDiff,
})
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[0]": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[2]": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[0]": map[string]interface{}{"kind": "UPDATE"},
"keys[1]": map[string]interface{}{"kind": "UPDATE"},
"keys[2]": map[string]interface{}{},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[1]": map[string]interface{}{"kind": "UPDATE"},
"keys[2]": map[string]interface{}{},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys": map[string]interface{}{"kind": "DELETE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[0]": map[string]interface{}{"kind": "UPDATE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[1]": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[1]": map[string]interface{}{"kind": "DELETE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[20]": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,27 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[0]": map[string]interface{}{"kind": "UPDATE"},
"keys[10]": map[string]interface{}{"kind": "UPDATE"},
"keys[11]": map[string]interface{}{"kind": "UPDATE"},
"keys[12]": map[string]interface{}{"kind": "UPDATE"},
"keys[13]": map[string]interface{}{"kind": "UPDATE"},
"keys[14]": map[string]interface{}{"kind": "UPDATE"},
"keys[15]": map[string]interface{}{"kind": "UPDATE"},
"keys[16]": map[string]interface{}{"kind": "UPDATE"},
"keys[17]": map[string]interface{}{"kind": "UPDATE"},
"keys[18]": map[string]interface{}{"kind": "UPDATE"},
"keys[19]": map[string]interface{}{"kind": "UPDATE"},
"keys[1]": map[string]interface{}{"kind": "UPDATE"},
"keys[20]": map[string]interface{}{},
"keys[2]": map[string]interface{}{"kind": "UPDATE"},
"keys[3]": map[string]interface{}{"kind": "UPDATE"},
"keys[4]": map[string]interface{}{"kind": "UPDATE"},
"keys[5]": map[string]interface{}{"kind": "UPDATE"},
"keys[6]": map[string]interface{}{"kind": "UPDATE"},
"keys[7]": map[string]interface{}{"kind": "UPDATE"},
"keys[8]": map[string]interface{}{"kind": "UPDATE"},
"keys[9]": map[string]interface{}{"kind": "UPDATE"},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys": map[string]interface{}{"kind": "DELETE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[0]": map[string]interface{}{"kind": "DELETE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[2]": map[string]interface{}{"kind": "DELETE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[0]": map[string]interface{}{"kind": "UPDATE"},
"keys[1]": map[string]interface{}{"kind": "UPDATE"},
"keys[2]": map[string]interface{}{"kind": "DELETE"},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ Resources:
~ 1 to update
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[1]": map[string]interface{}{"kind": "UPDATE"},
"keys[2]": map[string]interface{}{"kind": "DELETE"},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[0]": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[2]": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[0]": map[string]interface{}{"kind": "UPDATE"},
"keys[1]": map[string]interface{}{"kind": "UPDATE"},
"keys[2]": map[string]interface{}{},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[1]": map[string]interface{}{"kind": "UPDATE"},
"keys[2]": map[string]interface{}{},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys": map[string]interface{}{"kind": "DELETE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[0]": map[string]interface{}{"kind": "UPDATE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[1]": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[1]": map[string]interface{}{"kind": "DELETE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[20]": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,27 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[0]": map[string]interface{}{"kind": "UPDATE"},
"keys[10]": map[string]interface{}{"kind": "UPDATE"},
"keys[11]": map[string]interface{}{"kind": "UPDATE"},
"keys[12]": map[string]interface{}{"kind": "UPDATE"},
"keys[13]": map[string]interface{}{"kind": "UPDATE"},
"keys[14]": map[string]interface{}{"kind": "UPDATE"},
"keys[15]": map[string]interface{}{"kind": "UPDATE"},
"keys[16]": map[string]interface{}{"kind": "UPDATE"},
"keys[17]": map[string]interface{}{"kind": "UPDATE"},
"keys[18]": map[string]interface{}{"kind": "UPDATE"},
"keys[19]": map[string]interface{}{"kind": "UPDATE"},
"keys[1]": map[string]interface{}{"kind": "UPDATE"},
"keys[20]": map[string]interface{}{},
"keys[2]": map[string]interface{}{"kind": "UPDATE"},
"keys[3]": map[string]interface{}{"kind": "UPDATE"},
"keys[4]": map[string]interface{}{"kind": "UPDATE"},
"keys[5]": map[string]interface{}{"kind": "UPDATE"},
"keys[6]": map[string]interface{}{"kind": "UPDATE"},
"keys[7]": map[string]interface{}{"kind": "UPDATE"},
"keys[8]": map[string]interface{}{"kind": "UPDATE"},
"keys[9]": map[string]interface{}{"kind": "UPDATE"},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys": map[string]interface{}{"kind": "DELETE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[0]": map[string]interface{}{"kind": "DELETE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[2]": map[string]interface{}{"kind": "DELETE"}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[0]": map[string]interface{}{"kind": "UPDATE"},
"keys[1]": map[string]interface{}{"kind": "UPDATE"},
"keys[2]": map[string]interface{}{"kind": "DELETE"},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[1]": map[string]interface{}{"kind": "UPDATE"},
"keys[2]": map[string]interface{}{"kind": "DELETE"},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[0]": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{"keys[2]": map[string]interface{}{}},
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,9 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[0].nested": map[string]interface{}{"kind": "UPDATE"},
"keys[1].nested": map[string]interface{}{"kind": "UPDATE"},
"keys[2]": map[string]interface{}{},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ Resources:
+-1 to replace
1 unchanged
`,
detailedDiff: map[string]interface{}{
"keys[1].nested": map[string]interface{}{"kind": "UPDATE"},
"keys[2]": map[string]interface{}{},
},
}
Loading

0 comments on commit d7eacfb

Please sign in to comment.