You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/03/07 08:59:47 UTC
[camel-k] branch release-1.12.x updated: fix(test): code refactoring
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch release-1.12.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/release-1.12.x by this push:
new af971720e fix(test): code refactoring
af971720e is described below
commit af971720e8693866be89077b2647f0376e84c49d
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Mon Mar 6 14:48:27 2023 +0100
fix(test): code refactoring
Ref #4086
---
e2e/namespace/install/cli/delete_test.go | 8 --------
e2e/namespace/install/cli/kamelet_test.go | 4 ++--
e2e/namespace/install/cli/run_test.go | 16 ++++++++--------
e2e/namespace/native/native_binding_test.go | 4 ----
4 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/e2e/namespace/install/cli/delete_test.go b/e2e/namespace/install/cli/delete_test.go
index 3f2fb88c4..1d3f2a07a 100644
--- a/e2e/namespace/install/cli/delete_test.go
+++ b/e2e/namespace/install/cli/delete_test.go
@@ -52,14 +52,6 @@ func TestKamelCLIDelete(t *testing.T) {
Eventually(IntegrationPod(ns, "yaml"), TestTimeoutLong).Should(BeNil())
})
- t.Run("delete integration from csv", func(t *testing.T) {
- Expect(KamelRunWithID(operatorID, ns, "github:apache/camel-k/e2e/namespace/install/cli/files/yaml.yaml").Execute()).To(Succeed())
- Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
- Eventually(Integration(ns, "yaml")).Should(BeNil())
- Eventually(IntegrationPod(ns, "yaml"), TestTimeoutLong).Should(BeNil())
- })
-
t.Run("delete several integrations", func(t *testing.T) {
Expect(KamelRunWithID(operatorID, ns, "../files/yaml.yaml").Execute()).To(Succeed())
Expect(KamelRunWithID(operatorID, ns, "../files/Java.java").Execute()).To(Succeed())
diff --git a/e2e/namespace/install/cli/kamelet_test.go b/e2e/namespace/install/cli/kamelet_test.go
index 3a48ea918..f5cdf95a7 100644
--- a/e2e/namespace/install/cli/kamelet_test.go
+++ b/e2e/namespace/install/cli/kamelet_test.go
@@ -48,7 +48,7 @@ func TestKameletFromCustomRepository(t *testing.T) {
// Add the custom repository
Expect(Kamel("kamelet", "add-repo",
- "github:apache/camel-k/e2e/global/common/files/kamelets",
+ "github:squakez/ck-kamelet-test-repo/kamelets",
"-n", ns,
"-x", operatorID).Execute()).To(Succeed())
@@ -60,7 +60,7 @@ func TestKameletFromCustomRepository(t *testing.T) {
// Remove the custom repository
Expect(Kamel("kamelet", "remove-repo",
- "github:apache/camel-k/e2e/global/common/files/kamelets",
+ "github:squakez/ck-kamelet-test-repo/kamelets",
"-n", ns,
"-x", operatorID).Execute()).To(Succeed())
})
diff --git a/e2e/namespace/install/cli/run_test.go b/e2e/namespace/install/cli/run_test.go
index f853a76a3..6d75b8f18 100644
--- a/e2e/namespace/install/cli/run_test.go
+++ b/e2e/namespace/install/cli/run_test.go
@@ -37,7 +37,7 @@ import (
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
)
-var sampleJar = "https://raw.githubusercontent.com/apache/camel-k/main/e2e/global/common/traits/files/jvm/sample-1.0.jar"
+var sampleJar = "https://raw.githubusercontent.com/apache/camel-k/main/e2e/common/traits/files/jvm/sample-1.0.jar"
func TestKamelCLIRun(t *testing.T) {
WithNewTestNamespace(t, func(ns string) {
@@ -47,32 +47,32 @@ func TestKamelCLIRun(t *testing.T) {
t.Run("Examples from GitHub", func(t *testing.T) {
t.Run("Java", func(t *testing.T) {
Expect(KamelRunWithID(operatorID, ns,
- "github:apache/camel-k/e2e/namespace/install/files/Java.java").Execute()).To(Succeed())
+ "github:apache/camel-k-examples/generic-examples/languages/Sample.java", "--name", "java").Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationConditionStatus(ns, "java", v1.IntegrationConditionReady), TestTimeoutShort).
Should(Equal(corev1.ConditionTrue))
- Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
+ Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Hello Camel K!"))
Eventually(DeleteIntegrations(ns), TestTimeoutLong).Should(Equal(0))
})
t.Run("Java (RAW)", func(t *testing.T) {
Expect(KamelRunWithID(operatorID, ns,
- "https://raw.githubusercontent.com/apache/camel-k/main/e2e/namespace/install/files/Java.java").Execute()).
+ "https://raw.githubusercontent.com/apache/camel-k-examples/main/generic-examples/languages/Sample.java", "--name", "java").Execute()).
To(Succeed())
Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationConditionStatus(ns, "java", v1.IntegrationConditionReady), TestTimeoutShort).
Should(Equal(corev1.ConditionTrue))
- Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
+ Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Hello Camel K!"))
Eventually(DeleteIntegrations(ns), TestTimeoutLong).Should(Equal(0))
})
t.Run("Java (branch)", func(t *testing.T) {
Expect(KamelRunWithID(operatorID, ns,
- "github:apache/camel-k/e2e/namespace/install/files/Java.java?branch=main").Execute()).To(Succeed())
+ "github:apache/camel-k-examples/generic-examples/languages/Sample.java?branch=main", "--name", "java").Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationConditionStatus(ns, "java", v1.IntegrationConditionReady), TestTimeoutShort).
Should(Equal(corev1.ConditionTrue))
- Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
+ Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Hello Camel K!"))
Eventually(DeleteIntegrations(ns), TestTimeoutLong).Should(Equal(0))
})
@@ -172,7 +172,7 @@ func TestKamelCLIRun(t *testing.T) {
}
Expect(KamelRunWithID(operatorID, ns, "../../../global/common/traits/files/jvm/Classpath.java",
"-d", sampleJar,
- "-d", "https://raw.githubusercontent.com/apache/camel-k/main/e2e/namespace/install/cli/files/Java.java|targetPath=/tmp/foo",
+ "-d", "https://raw.githubusercontent.com/apache/camel-k-examples/main/generic-examples/languages/Sample.java|targetPath=/tmp/foo",
).Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "classpath"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationConditionStatus(ns, "classpath", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
diff --git a/e2e/namespace/native/native_binding_test.go b/e2e/namespace/native/native_binding_test.go
index e9a749df0..c685b4a49 100644
--- a/e2e/namespace/native/native_binding_test.go
+++ b/e2e/namespace/native/native_binding_test.go
@@ -95,10 +95,6 @@ func TestNativeBinding(t *testing.T) {
Eventually(IntegrationPod(ns, bindingName), TestTimeoutShort).
Should(WithTransform(getContainerCommand(),
MatchRegexp(".*camel-k-integration-\\d+\\.\\d+\\.\\d+[-A-Za-z]*-runner.*")))
-
- // Clean up
- Expect(Kamel("delete", bindingName, "-n", ns).Execute()).To(Succeed())
- Expect(DeleteKits(ns)).To(Succeed())
})
// Clean up