This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 67dc23a94cc5cbb85f6220936df7ce6c5b2eda71 Author: Pasquale Congiusti <[email protected]> AuthorDate: Mon Feb 27 17:28:15 2023 +0100 chore: rewrite log test --- e2e/common/cli/log_test.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/e2e/common/cli/log_test.go b/e2e/common/cli/log_test.go index 80a39ccee..71b5b506c 100644 --- a/e2e/common/cli/log_test.go +++ b/e2e/common/cli/log_test.go @@ -26,31 +26,29 @@ import ( "strings" "testing" - corev1 "k8s.io/api/core/v1" - - . "github.com/onsi/gomega" - . "github.com/apache/camel-k/e2e/support" + . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" ) func TestKamelCLILog(t *testing.T) { RegisterTestingT(t) t.Run("check integration log", func(t *testing.T) { - Expect(KamelRunWithID(operatorID, ns, "files/yaml.yaml").Execute()).To(Succeed()) - Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) + Expect(KamelRunWithID(operatorID, ns, "files/yaml.yaml", "--name", "log-yaml").Execute()).To(Succeed()) + Eventually(IntegrationPodPhase(ns, "log-yaml"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) // first line of the integration logs - firstLine := strings.Split(IntegrationLogs(ns, "yaml")(), "\n")[0] - podName := IntegrationPod(ns, "yaml")().Name + firstLine := strings.Split(IntegrationLogs(ns, "log-yaml")(), "\n")[0] + podName := IntegrationPod(ns, "log-yaml")().Name - logsCLI := GetOutputStringAsync(Kamel("log", "yaml", "-n", ns)) + logsCLI := GetOutputStringAsync(Kamel("log", "log-yaml", "-n", ns)) Eventually(logsCLI).Should(ContainSubstring("Monitoring pod " + podName)) Eventually(logsCLI).Should(ContainSubstring(firstLine)) - logs := strings.Split(IntegrationLogs(ns, "yaml")(), "\n") + logs := strings.Split(IntegrationLogs(ns, "log-yaml")(), "\n") lastLine := logs[len(logs)-1] - logsCLI = GetOutputStringAsync(Kamel("log", "yaml", "-n", ns, "--tail", "5")) + logsCLI = GetOutputStringAsync(Kamel("log", "log-yaml", "-n", ns, "--tail", "5")) Eventually(logsCLI).Should(ContainSubstring("Monitoring pod " + podName)) Eventually(logsCLI).Should(ContainSubstring(lastLine)) })
