You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ts...@apache.org on 2022/10/25 02:26:55 UTC

[camel-k] 01/02: chore(e2e): reformat olm_upgrade_test.go

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

tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit b0e8dac2223a4f6a791ed5e7b49255e6085c456c
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Mon Oct 24 16:26:12 2022 +0900

    chore(e2e): reformat olm_upgrade_test.go
---
 e2e/namespace/upgrade/olm_upgrade_test.go | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/e2e/namespace/upgrade/olm_upgrade_test.go b/e2e/namespace/upgrade/olm_upgrade_test.go
index 6b71804c7..24d2c33ff 100644
--- a/e2e/namespace/upgrade/olm_upgrade_test.go
+++ b/e2e/namespace/upgrade/olm_upgrade_test.go
@@ -84,7 +84,13 @@ func TestOLMAutomaticUpgrade(t *testing.T) {
 		// Set KAMEL_BIN only for this test - don't override the ENV variable for all tests
 		Expect(os.Setenv("KAMEL_BIN", kamel)).To(Succeed())
 
-		args := []string{"install", "-n", ns, "--olm=true", "--olm-source", catalogSourceName, "--olm-source-namespace", ns}
+		args := []string{
+			"install",
+			"-n", ns,
+			"--olm=true",
+			"--olm-source", catalogSourceName,
+			"--olm-source-namespace", ns,
+		}
 
 		if prevUpdateChannel != "" {
 			args = append(args, "--olm-channel", prevUpdateChannel)
@@ -96,7 +102,8 @@ func TestOLMAutomaticUpgrade(t *testing.T) {
 		noAdditionalConditions := func(csv olm.ClusterServiceVersion) bool {
 			return true
 		}
-		Eventually(clusterServiceVersionPhase(noAdditionalConditions, ns), TestTimeoutMedium).Should(Equal(olm.CSVPhaseSucceeded))
+		Eventually(clusterServiceVersionPhase(noAdditionalConditions, ns), TestTimeoutMedium).
+			Should(Equal(olm.CSVPhaseSucceeded))
 
 		// Refresh the test client to account for the newly installed CRDs
 		SyncClient()
@@ -123,7 +130,8 @@ func TestOLMAutomaticUpgrade(t *testing.T) {
 		Expect(Kamel("run", "-n", ns, "files/yaml.yaml").Execute()).To(Succeed())
 		// Check the Integration runs correctly
 		Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
-		Eventually(IntegrationConditionStatus(ns, name, v1.IntegrationConditionReady), TestTimeoutLong).Should(Equal(corev1.ConditionTrue))
+		Eventually(IntegrationConditionStatus(ns, name, v1.IntegrationConditionReady), TestTimeoutLong).
+			Should(Equal(corev1.ConditionTrue))
 
 		// Check the Integration version matches that of the current operator
 		Expect(IntegrationVersion(ns, name)()).To(ContainSubstring(prevIPVersionPrefix))
@@ -140,7 +148,9 @@ func TestOLMAutomaticUpgrade(t *testing.T) {
 
 				// Patch the Subscription to avoid conflicts with concurrent updates performed by OLM
 				patch := fmt.Sprintf("{\"spec\":{\"channel\":%q}}", newUpdateChannel)
-				Expect(TestClient().Patch(TestContext, subscription, ctrl.RawPatch(types.MergePatchType, []byte(patch)))).To(Succeed())
+				Expect(
+					TestClient().Patch(TestContext, subscription, ctrl.RawPatch(types.MergePatchType, []byte(patch))),
+				).To(Succeed())
 				// Assert the response back from the API server
 				Expect(subscription.Spec.Channel).To(Equal(newUpdateChannel))
 			}
@@ -177,14 +187,16 @@ func TestOLMAutomaticUpgrade(t *testing.T) {
 			Expect(os.Setenv("KAMEL_BIN", "")).To(Succeed())
 
 			// Check the Integration hasn't been upgraded
-			Consistently(IntegrationVersion(ns, name), 5*time.Second, 1*time.Second).Should(ContainSubstring(prevIPVersionPrefix))
+			Consistently(IntegrationVersion(ns, name), 5*time.Second, 1*time.Second).
+				Should(ContainSubstring(prevIPVersionPrefix))
 
 			// Rebuild the Integration
 			Expect(Kamel("rebuild", name, "-n", ns).Execute()).To(Succeed())
 
 			// Check the Integration runs correctly
 			Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
-			Eventually(IntegrationConditionStatus(ns, name, v1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(corev1.ConditionTrue))
+			Eventually(IntegrationConditionStatus(ns, name, v1.IntegrationConditionReady), TestTimeoutMedium).
+				Should(Equal(corev1.ConditionTrue))
 
 			// Check the Integration version has been upgraded
 			Eventually(IntegrationVersion(ns, name)).Should(ContainSubstring(newIPVersionPrefix))
@@ -207,7 +219,8 @@ func TestOLMAutomaticUpgrade(t *testing.T) {
 
 			// Check the Integration runs correctly
 			Eventually(IntegrationPodPhase(ns, name)).Should(Equal(corev1.PodRunning))
-			Eventually(IntegrationConditionStatus(ns, name, v1.IntegrationConditionReady), TestTimeoutLong).Should(Equal(corev1.ConditionTrue))
+			Eventually(IntegrationConditionStatus(ns, name, v1.IntegrationConditionReady), TestTimeoutLong).
+				Should(Equal(corev1.ConditionTrue))
 
 			// Clean up
 			Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())