make test: collect symlinks to failed tests
Compress files in temporary directories of failed tests and symlink
the directories under /tmp/vpp-failed-unittests location - preparation
for jenkins archivation. Automatically cleanup the directory at start
of test run.
The compression is performed only when environment variable
COMPRESS_FAILED_TEST_LOGS is set to one of "yes", "y", "1".
This is set in verify target, but left unset by default, so when
invoking make test by hand, files won't be compressed.
Change-Id: I84c8f1c6aa79aa9c0b753357022b1f195f17a283
Signed-off-by: Klement Sekera <ksekera@cisco.com>
diff --git a/test/Makefile b/test/Makefile
index 33779dc..72b4dac 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,5 +1,7 @@
.PHONY: verify-python-path
+VPP_TEST_FAILED_DIR=/tmp/vpp-failed-unittests/
+
verify-python-path:
ifndef VPP_PYTHON_PREFIX
$(error VPP_PYTHON_PREFIX is not set)
@@ -84,7 +86,8 @@
@touch $@
define retest-func
- @scripts/setsid_wrapper.sh $(FORCE_FOREGROUND) $(PYTHON_VENV_PATH)/bin/activate python run_tests.py -d $(TEST_DIR) $(UNITTEST_EXTRA_OPTS)
+ @env VPP_TEST_FAILED_DIR=$(VPP_TEST_FAILED_DIR) scripts/setsid_wrapper.sh $(FORCE_FOREGROUND) $(PYTHON_VENV_PATH)/bin/activate python run_tests.py -d $(TEST_DIR) $(UNITTEST_EXTRA_OPTS)
+ @env VPP_TEST_FAILED_DIR=$(VPP_TEST_FAILED_DIR) scripts/compress_failed.sh
endef
.PHONY: sanity
@@ -129,6 +132,8 @@
reset:
@rm -f /dev/shm/vpp-unittest-*
@rm -rf /tmp/vpp-unittest-*
+ @rm -rf $(VPP_TEST_FAILED_DIR)
+ @mkdir $(VPP_TEST_FAILED_DIR)
wipe: reset
@rm -rf $(PYTHON_VENV_PATH)