You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2022/01/19 08:40:54 UTC
[camel-k] 28/32: chore(e2e): assert HTTP proxy logs
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch release-1.7.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 1b155d7aaee1699a2600473c991fc9b7db4eae92
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Jan 11 19:01:56 2022 +0100
chore(e2e): assert HTTP proxy logs
---
e2e/common/build/maven_http_proxy_test.go | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/e2e/common/build/maven_http_proxy_test.go b/e2e/common/build/maven_http_proxy_test.go
index 577aacb..4bfed60 100644
--- a/e2e/common/build/maven_http_proxy_test.go
+++ b/e2e/common/build/maven_http_proxy_test.go
@@ -43,6 +43,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
+ ctrl "sigs.k8s.io/controller-runtime/pkg/client"
+
. "github.com/apache/camel-k/e2e/support"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
)
@@ -325,7 +327,22 @@ ProxyVia Off
Eventually(IntegrationCondition(ns, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
- // TODO: assert the proxy logs
+ proxies := corev1.PodList{
+ TypeMeta: metav1.TypeMeta{
+ Kind: "Pod",
+ APIVersion: corev1.SchemeGroupVersion.String(),
+ },
+ }
+ err = TestClient().List(TestContext, &proxies,
+ ctrl.InNamespace(ns),
+ ctrl.MatchingLabels(deployment.Spec.Selector.MatchLabels),
+ )
+ Expect(err).To(Succeed())
+ Expect(proxies.Items).To(HaveLen(1))
+
+ logs := Logs(ns, proxies.Items[0].Name, corev1.PodLogOptions{})()
+ Expect(logs).NotTo(BeEmpty())
+ Expect(logs).To(ContainSubstring("\"CONNECT repo.maven.apache.org:443 HTTP/1.1\" 200"))
// Clean up
Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())