Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
print controller logs on e2e test failure
Browse files Browse the repository at this point in the history
Signed-off-by: Shinya Hayashi <[email protected]>
peng225 committed Jan 21, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 8927ae8 commit a01e412
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions test/e2e/Makefile
Original file line number Diff line number Diff line change
@@ -249,7 +249,15 @@ do_test: $(GINKGO)
PATH=${PATH} \
E2ETEST=1 \
KUBECTL=$(KUBECTL) \
$(GINKGO) --fail-fast -v $(GINKGO_FLAGS) singlek8s
$(GINKGO) --fail-fast -v $(GINKGO_FLAGS) singlek8s; \
if [ "$$?" -ne 0 ]; then \
echo "namespace: $(CEPH_CLUSTER1_NAMESPACE)"; \
$(KUBECTL) logs --tail 100 -n $(CEPH_CLUSTER1_NAMESPACE) -l app.kubernetes.io/name=mantle; \
echo "namespace: $(CEPH_CLUSTER2_NAMESPACE)"; \
$(KUBECTL) logs --tail 100 -n $(CEPH_CLUSTER2_NAMESPACE) -l app.kubernetes.io/name=mantle; \
# Explicitly fail the test to mark the CI job as failed. \
exit 1; \
fi

.PHONY: do-test-multik8s
do-test-multik8s: $(GINKGO)
@@ -258,4 +266,12 @@ do-test-multik8s: $(GINKGO)
E2ETEST=1 \
KUBECTL_PRIMARY="$(MINIKUBE) -p $(MINIKUBE_PROFILE_PRIMARY) kubectl -- " \
KUBECTL_SECONDARY="$(MINIKUBE) -p $(MINIKUBE_PROFILE_SECONDARY) kubectl -- " \
$(GINKGO) --fail-fast -v $(GINKGO_FLAGS) $(addprefix multik8s/, $(TEST_MULTIK8S_PACKAGES))
$(GINKGO) --fail-fast -v $(GINKGO_FLAGS) $(addprefix multik8s/, $(TEST_MULTIK8S_PACKAGES)); \
if [ "$$?" -ne 0 ]; then \
echo "profile: $(MINIKUBE_PROFILE_PRIMARY)"; \
$(MINIKUBE) -p $(MINIKUBE_PROFILE_PRIMARY) kubectl -- logs --tail 100 -n $(CEPH_CLUSTER1_NAMESPACE) -l app.kubernetes.io/name=mantle; \
echo "profile: $(MINIKUBE_PROFILE_SECONDARY)"; \
$(MINIKUBE) -p $(MINIKUBE_PROFILE_SECONDARY) kubectl -- logs --tail 100 -n $(CEPH_CLUSTER1_NAMESPACE) -l app.kubernetes.io/name=mantle; \
# Explicitly fail the test to mark the CI job as failed. \
exit 1; \
fi

0 comments on commit a01e412

Please sign in to comment.