Skip to content

Commit

Permalink
Add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
hongkailiu committed Oct 8, 2024
1 parent 5cfc3bf commit 9e6149b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/payload/precondition/clusterversion/upgradeable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ func TestUpgradeableRun(t *testing.T) {
desiredVersion: "4.17.0",
upgradeable: ptr(configv1.ConditionFalse),
},
{
name: "allow for any z retarget even if smaller",
currVersion: "4.16.z",
versionPartiallyUpgraded: "4.17.2",
desiredVersion: "4.17.1",
upgradeable: ptr(configv1.ConditionFalse),
},
{
name: "allow for any z retarget even release candidate",
currVersion: "4.16.1",
Expand All @@ -151,6 +158,23 @@ func TestUpgradeableRun(t *testing.T) {
upgradeable: ptr(configv1.ConditionFalse),
expected: "set to False",
},
{
name: "empty target",
},
{
name: "invalid target",
desiredVersion: "not-valid-version-name",
},
{
name: "downgrade",
currVersion: "4.16.1",
desiredVersion: "4.15.3",
},
{
name: "move to y+2 directly",
currVersion: "4.16.1",
desiredVersion: "4.18.3",
},
}

for _, tc := range tests {
Expand Down

0 comments on commit 9e6149b

Please sign in to comment.