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 authored and squakez committed Dec 5, 2023
1 parent 57ccc94 commit 8efebb5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion e2e/install/upgrade/helm_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ limitations under the License.
package upgrade

import (
"errors"
"fmt"
"os"
"os/exec"
Expand All @@ -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", "../../../")
Expand All @@ -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",
Expand Down

0 comments on commit 8efebb5

Please sign in to comment.