Skip to content

Commit

Permalink
Merge pull request #437 from akgalwas/fix-comparator-unit-tests
Browse files Browse the repository at this point in the history
Fixed regression in Comparator tests
  • Loading branch information
m00g3n authored Oct 23, 2024
2 parents a98775a + bc29069 commit 52d06e2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hack/shoot-comparator/pkg/shoot/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ func (m *Matcher) Match(actual interface{}) (success bool, err error) {
actual: shootActual.Spec.Extensions,
path: "spec/extensions",
},
{
GomegaMatcher: gomega.BeComparableTo(shootToMatch.Spec.CloudProfileName),
actual: shootActual.Spec.CloudProfileName,
path: "spec/cloudProfileName",
},
{
GomegaMatcher: gstruct.MatchFields(gstruct.IgnoreMissing, gstruct.Fields{
"ClusterAutoscaler": gstruct.Ignore(),
Expand Down
20 changes: 20 additions & 0 deletions hack/shoot-comparator/pkg/shoot/matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,26 @@ var _ = Describe(":: shoot matcher :: ", func() {
deepCp(empty, withLabels(map[string]string{})),
false,
),
Entry(
"should detect differences in spec/exposureClassName #1",
deepCp(empty, withShootSpec(v1beta1.ShootSpec{
ExposureClassName: ptr.To[string]("mage"),
})),
deepCp(empty, withShootSpec(v1beta1.ShootSpec{
ExposureClassName: ptr.To[string]("bard"),
})),
false,
),
Entry(
"should detect no differences in spec/exposureClassName #1",
deepCp(empty, withShootSpec(v1beta1.ShootSpec{
ExposureClassName: ptr.To[string]("mage"),
})),
deepCp(empty, withShootSpec(v1beta1.ShootSpec{
ExposureClassName: ptr.To[string]("mage"),
})),
true,
),
Entry(
"should detect differences in spec/secretBindingName #1",
deepCp(empty, withShootSpec(v1beta1.ShootSpec{
Expand Down

0 comments on commit 52d06e2

Please sign in to comment.