Tests: Do not remove interrupted test log files by default
authorKienan Stewart <kstewart@efficios.com>
Fri, 26 Jul 2024 14:46:40 +0000 (10:46 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 30 Aug 2024 20:39:50 +0000 (16:39 -0400)
Observed issue
==============

During CI runs, builds may timeout or be killed for another reason.
Those tests logs are deleted and cannot be checked for diagnostic
information, warnings, or errors.

Cause
=====

By default, the test log for the currently running test is deleted by
automake so that subsequent invocations of `make check` will re-run the test.

Solution
========

Add a disable flag `--disable-precious-tests` and set
`PRECIOUS_TESTS` to true by default when configuring lttng-tools. When
`PRECIOUS_TOOLS` is set, all test logs in `tests/regression` will be
marked as `.PRECIOUS` and subsequently not deleted when interrupted.

Known drawbacks
===============

This could make interrupting a test and re-running during test
development more of a hassle.

References
==========

[1]: https://www.gnu.org/software/make/manual/html_node/Special-Targets.html
[2]: https://automake.gnu.narkive.com/1TjEGbH2/delete-on-error-test-suite-log-and-precious

Change-Id: I08b4a1bb29eb609827cc1c047f141f94b210effe
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
tests/regression/Makefile.am

index 0a4d726d7d1b32113004ce84bc41f265e5832e9e..b6309378c85e64b0a5c9b55274b9b10fbd709f4f 100644 (file)
@@ -979,6 +979,18 @@ AS_IF([test "$test_sdt_uprobe" = "autodetect"], [
 
 AM_CONDITIONAL([TEST_SDT_UPROBE], [test "$test_sdt_uprobe" = "yes"])
 
+AC_ARG_ENABLE(
+       [precious-tests],
+       AS_HELP_STRING(
+               [--disable-precious-tests],
+               [Delete log files for interrupted tests]
+       ),
+       [precious_tests=$enableval],
+       [precious_tests=yes]
+)
+
+AM_CONDITIONAL([PRECIOUS_TESTS], [test x$precious_tests = xyes])
+
 AC_ARG_ENABLE([lib-lttng-ctl], AS_HELP_STRING([--disable-lib-lttng-ctl],
        [Disable the build of liblttng-ctl (only possible if no binaries that depend on it are built)]))
 
index 5ee205026eaf912edfcb5ba4d020df3eb62c0525..1b790b706cc865ff8006021b14b79406146a7f15 100644 (file)
@@ -143,3 +143,7 @@ TESTS += ust/linking/test_linking \
        ust/ust-dl/test_ust-dl \
        ust/type-declarations/test_type_declarations
 endif
+
+if PRECIOUS_TESTS
+.PRECIOUS: $(TEST_LOGS)
+endif
This page took 0.026409 seconds and 4 git commands to generate.