Skip to content

Commit

Permalink
add test summary at the end of the eco ci run
Browse files Browse the repository at this point in the history
  • Loading branch information
shellymiron committed Jul 1, 2024
1 parent 3a9b626 commit 1c39b38
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Define ANSI escape codes for colors
GREEN=\033[0;32m
RED=\033[0;31m
NC=\033[0m # No Color

QUAY_USER ?= vmware_ops
QUAY_TAG ?= latest

Expand Down Expand Up @@ -27,10 +32,28 @@ integration: install-python-packages install-ansible-collections prepare_symlink
ansible-test integration --no-temp-workdir

.PHONY: eco-vcenter-ci
eco-vcenter-ci: install-python-packages install-ansible-collections prepare_symlinks install-pyvmomy-latest
@for dir in $(shell ansible-test integration --list-target --no-temp-workdir | grep 'vmware_ops_'); do \
ansible-test integration --no-temp-workdir $$dir; \
done
eco-vcenter-ci: prepare_symlinks
@[ -f /tmp/vmware_ops_failed_tests.txt ] && rm /tmp/vmware_ops_failed_tests.txt || true; \
@failed=0; \
total=0; \
echo "===============" >> /tmp/vmware_ops_failed_tests.txt; \
echo "Tests Summary" >> /tmp/vmware_ops_failed_tests.txt; \
echo "===============" >> /tmp/vmware_ops_failed_tests.txt; \
for dir in $(shell ansible-test integration --list-target --no-temp-workdir | grep 'vmware_ops_'); do \
echo "Running integration test for $$dir"; \
total=$$((total + 1)); \
if ansible-test integration --no-temp-workdir $$dir; then \
echo -e "Test: $$dir ${GREEN}Passed${NC}" | tee -a /tmp/vmware_ops_failed_tests.txt; \
else \
echo -e "Test: $$dir ${RED}Failed${NC}" | tee -a /tmp/vmware_ops_failed_tests.txt; \
failed=$$((failed + 1)); \
fi; \
done; \
if [ $$failed -gt 0 ]; then \
echo "$$failed test(s) failed out of $$total." >> /tmp/vmware_ops_failed_tests.txt; \
cat /tmp/vmware_ops_failed_tests.txt; \
exit 1; \
fi

.PHONY: ee-clean
ee-clean:
Expand Down

0 comments on commit 1c39b38

Please sign in to comment.