Skip to content

Commit

Permalink
chore: fix e2e upgrade test - add missing effective semver (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo authored Feb 5, 2025
1 parent 5e70451 commit fb48dea
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions test/e2e/test_helm_install_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ func TestHelmUpgrade(t *testing.T) {
}

testCases := []struct {
name string
fromVersion string
toVersion string
objectsToDeploy []client.Object
upgradeToCurrent bool
assertionsAfterInstall []assertion
assertionsAfterUpgrade []assertion
name string
fromVersion string
toVersion string
objectsToDeploy []client.Object
upgradeToCurrent bool
// If upgrading to an image tag that's not a valid semver, fill this to the effective semver so that charts
// can correctly render semver-conditional templates.
upgradeToEffectiveSemver string
assertionsAfterInstall []assertion
assertionsAfterUpgrade []assertion
}{
{
name: "upgrade from one before latest to latest minor",
Expand Down Expand Up @@ -138,6 +141,9 @@ func TestHelmUpgrade(t *testing.T) {
name: "upgrade from latest minor to current",
fromVersion: "1.4.0", // renovate: datasource=docker packageName=kong/gateway-operator-oss
upgradeToCurrent: true,
// This is the effective semver of a next release. It's needed for the chart to properly render
// semver-conditional templates.
upgradeToEffectiveSemver: "1.5.0",
objectsToDeploy: []client.Object{
&operatorv1beta1.GatewayConfiguration{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -332,6 +338,10 @@ func TestHelmUpgrade(t *testing.T) {
"anonymous_reports": "false",
}

if tc.upgradeToEffectiveSemver != "" {
values["image.effectiveSemver"] = tc.upgradeToEffectiveSemver
}

opts := &helm.Options{
KubectlOptions: &k8s.KubectlOptions{
Namespace: e.Namespace.Name,
Expand Down

0 comments on commit fb48dea

Please sign in to comment.