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 e2df91d
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 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 @@ -26,11 +31,34 @@ install-pyvmomy-latest:
integration: install-python-packages install-ansible-collections prepare_symlinks
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
.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 e2df91d

Please sign in to comment.