Skip to content

Commit

Permalink
fix(e2e): Execute helm upgrade test only on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gansheer committed Dec 5, 2023
1 parent e33e64e commit d04d41d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion e2e/install/upgrade/helm_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ limitations under the License.
package upgrade

import (
"errors"
"fmt"
"os"
"os/exec"
Expand All @@ -39,6 +40,14 @@ func TestHelmOperatorUpgrade(t *testing.T) {
KAMEL_INSTALL_REGISTRY := os.Getenv("KAMEL_INSTALL_REGISTRY")
// need to add last release version
releaseVersion := os.Getenv("KAMEL_K_TEST_RELEASE_VERSION")

// if the last released version chart is not present skip the test
releaseChart := fmt.Sprintf("../../../docs/charts/camel-k-%s.tgz", releaseVersion)
if _, err := os.Stat(releaseChart); errors.Is(err, os.ErrNotExist) {
t.Skip("last release version chart not found: skipping")
return
}

customImage := fmt.Sprintf("%s/apache/camel-k", KAMEL_INSTALL_REGISTRY)

os.Setenv("CAMEL_K_TEST_MAKE_DIR", "../../../")
Expand All @@ -55,7 +64,7 @@ func TestHelmOperatorUpgrade(t *testing.T) {
"helm",
"install",
"camel-k",
fmt.Sprintf("../../../docs/charts/camel-k-%s.tgz", releaseVersion),
releaseChart,
"--set",
fmt.Sprintf("platform.build.registry.address=%s", KAMEL_INSTALL_REGISTRY),
"--set",
Expand Down

0 comments on commit d04d41d

Please sign in to comment.