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

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

commit b5d48e507cf8b253ca724955c6f43491deaa495f
Author: Pasquale Congiusti <pasquale.congiu...@gmail.com>
AuthorDate: Mon May 13 15:37:56 2024 +0200

    fix(e2e): strengthen upgrade test scenario
    
    An IntegrationPod should not be rolled over during the operator upgrade
---
 e2e/install/upgrade/cli_upgrade_test.go | 7 ++++++-
 e2e/install/upgrade/olm_upgrade_test.go | 7 +++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/e2e/install/upgrade/cli_upgrade_test.go 
b/e2e/install/upgrade/cli_upgrade_test.go
index 90da1cb5a..1b4fec997 100644
--- a/e2e/install/upgrade/cli_upgrade_test.go
+++ b/e2e/install/upgrade/cli_upgrade_test.go
@@ -96,7 +96,12 @@ func TestCLIOperatorUpgrade(t *testing.T) {
                // Check the IntegrationPlatform has been reconciled
                g.Eventually(PlatformPhase(t, ctx, ns), 
TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
                g.Eventually(PlatformVersion(t, ctx, ns), 
TestTimeoutMedium).Should(Equal(defaults.Version))
-
+               // Check the Integration Pod is not rolling a new Pod 
automatically
+               // This is extremely important as we don't want an upgrade to 
restart any Integration, unless specified by the user
+               var numberOfPods = func(pods *int32) bool {
+                       return *pods == 1
+               }
+               g.Consistently(IntegrationPodsNumbers(t, ctx, ns, name), 
1*time.Minute, 1*time.Second).Should(Satisfy(numberOfPods))
                // Check the Integration hasn't been upgraded
                g.Consistently(IntegrationVersion(t, ctx, ns, name), 
5*time.Second, 1*time.Second).Should(Equal(version))
 
diff --git a/e2e/install/upgrade/olm_upgrade_test.go 
b/e2e/install/upgrade/olm_upgrade_test.go
index ac8bcf472..62972a7ab 100644
--- a/e2e/install/upgrade/olm_upgrade_test.go
+++ b/e2e/install/upgrade/olm_upgrade_test.go
@@ -201,6 +201,13 @@ func TestOLMOperatorUpgrade(t *testing.T) {
                        // Clear the KAMEL_BIN environment variable so that the 
current version is used from now on
                        g.Expect(os.Setenv("KAMEL_BIN", "")).To(Succeed())
 
+                       // Check the Integration Pod is not rolling a new Pod 
automatically
+                       // This is extremely important as we don't want an 
upgrade to restart any Integration, unless specified by the user
+                       var numberOfPods = func(pods *int32) bool {
+                               return *pods == 1
+                       }
+                       g.Consistently(IntegrationPodsNumbers(t, ctx, ns, 
name), 1*time.Minute, 1*time.Second).Should(Satisfy(numberOfPods))
+
                        // Check the Integration hasn't been upgraded
                        g.Consistently(IntegrationVersion(t, ctx, ns, name), 
5*time.Second, 1*time.Second).
                                Should(ContainSubstring(prevIPVersionPrefix))

Reply via email to