Skip to content

Commit

Permalink
fix(e2e): strengthen upgrade test
Browse files Browse the repository at this point in the history
We must identify if a rolled out Pod after an upgrade is turning ready as expected. If not we have a possible breaking compatibility change
  • Loading branch information
squakez committed May 17, 2024
1 parent 5ceed9d commit bb7fcfb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion e2e/install/upgrade/cli_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ func TestCLIOperatorUpgrade(t *testing.T) {
g.Eventually(PlatformVersion(t, ctx, ns), TestTimeoutMedium).Should(Equal(defaults.Version))

// Check the Integration hasn't been upgraded
g.Consistently(IntegrationVersion(t, ctx, ns, name), 5*time.Second, 1*time.Second).Should(Equal(version))
g.Consistently(IntegrationVersion(t, ctx, ns, name), 15*time.Second, 3*time.Second).Should(Equal(version))
// Make sure that any Pod rollout is completing successfully
// otherwise we are probably in front of a non breaking compatibility change
g.Consistently(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady),
2*time.Minute, 15*time.Second).Should(Equal(corev1.ConditionTrue))

// Force the Integration upgrade
g.Expect(Kamel(t, ctx, "rebuild", name, "-n", ns).Execute()).To(Succeed())
Expand Down
11 changes: 9 additions & 2 deletions e2e/install/upgrade/olm_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ func TestOLMOperatorUpgrade(t *testing.T) {
g.Consistently(IntegrationVersion(t, ctx, ns, name), 5*time.Second, 1*time.Second).
Should(ContainSubstring(prevIPVersionPrefix))

// Make sure that any Pod rollout is completing successfully
// otherwise we are probably in front of a non breaking compatibility change
g.Consistently(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady),
2*time.Minute, 15*time.Second).Should(Equal(corev1.ConditionTrue))
g.Consistently(IntegrationConditionStatus(t, ctx, ns, kbindName, v1.IntegrationConditionReady),
2*time.Minute, 15*time.Second).Should(Equal(corev1.ConditionTrue))

// Rebuild the Integration
g.Expect(Kamel(t, ctx, "rebuild", "--all", "-n", ns).Execute()).To(Succeed())
if prevCSVVersion.Version.String() >= "2" {
Expand Down Expand Up @@ -244,9 +251,9 @@ func TestOLMOperatorUpgrade(t *testing.T) {
// Check the Integration runs correctly
g.Eventually(IntegrationPodPhase(t, ctx, ns, name)).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationPodPhase(t, ctx, ns, kbindName)).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutLong).
g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutMedium).
Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationConditionStatus(t, ctx, ns, kbindName, v1.IntegrationConditionReady), TestTimeoutLong).
g.Eventually(IntegrationConditionStatus(t, ctx, ns, kbindName, v1.IntegrationConditionReady), TestTimeoutMedium).
Should(Equal(corev1.ConditionTrue))

// Clean up
Expand Down

0 comments on commit bb7fcfb

Please sign in to comment.