This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit a00770741ff95f73b8120447d3226a01173cbbd3 Author: Antonin Stefanutti <[email protected]> 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 dfc6e0f..9bbcbe3 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(IntegrationConditionStatus(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())
