Skip to content

Add detailed diff recordings to PF diff tests #2657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
Loading