This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch release-2.1.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 279b8ce75d47649769f4e22de8aa8f7cb3a7fb4b
Author: Gaelle Fournier <gaelle.fournier.w...@gmail.com>
AuthorDate: Fri Dec 1 16:07:26 2023 +0100

    fix(e2e): Execute helm upgrade test only on main branch
---
 e2e/install/upgrade/helm_upgrade_test.go | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/e2e/install/upgrade/helm_upgrade_test.go 
b/e2e/install/upgrade/helm_upgrade_test.go
index bcbb7b4c2..b0ec7a029 100644
--- a/e2e/install/upgrade/helm_upgrade_test.go
+++ b/e2e/install/upgrade/helm_upgrade_test.go
@@ -23,6 +23,7 @@ limitations under the License.
 package upgrade
 
 import (
+       "errors"
        "fmt"
        "os"
        "os/exec"
@@ -41,6 +42,13 @@ 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", "../../../")
@@ -57,7 +65,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",

Reply via email to