From 44f080879bde96c072cb8352543469a32aec018a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 26 Jan 2023 12:51:17 +0100 Subject: [PATCH] gitlab-ci: rerun meson test on failure with debugging Like done for autotools. First we run the test without debugging option. If it fails, we run it again to possibly trigger the failure again and get better logs. (cherry picked from commit 13d9cf75ed6e0daea22205b28f218c53bc604ba8) --- contrib/scripts/nm-ci-run.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh index 22450d40c7..374dde95b3 100755 --- a/contrib/scripts/nm-ci-run.sh +++ b/contrib/scripts/nm-ci-run.sh @@ -197,21 +197,18 @@ run_autotools() { export NM_TEST_CLIENT_CHECK_L10N=1 if ! make check -j 6 -k ; then - _print_test_logs "first-test" - echo ">>>> RUN SECOND TEST (start)" NMTST_DEBUG="debug,TRACE,no-expect-message" make check -k || : echo ">>>> RUN SECOND TEST (done)" - _print_test_logs "second-test" - die "test failed" + die "autotools test failed" fi if _with_valgrind; then if ! NMTST_USE_VALGRIND=1 make check -j 3 -k ; then _print_test_logs "(valgrind test)" - die "valgrind test failed" + die "autotools+valgrind test failed" fi fi popd @@ -267,12 +264,18 @@ run_meson() { ninja -C build ninja -C build install - ninja -C build test + + if ! ninja -C build test ; then + echo ">>>> RUN SECOND TEST (start)" + NMTST_DEBUG="debug,TRACE,no-expect-message" ninja -C build test || : + echo ">>>> RUN SECOND TEST (done)" + die "meson test failed" + fi if _with_valgrind; then if ! NMTST_USE_VALGRIND=1 ninja -C build test; then _print_test_logs "(valgrind test)" - die "valgrind test failed" + die "meson+valgrind test failed" fi fi }