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.
This commit is contained in:
Thomas Haller
2023-01-26 12:51:17 +01:00
parent 3f2ad76363
commit 13d9cf75ed

View File

@@ -197,21 +197,18 @@ run_autotools() {
export NM_TEST_CLIENT_CHECK_L10N=1 export NM_TEST_CLIENT_CHECK_L10N=1
if ! make check -j 6 -k ; then if ! make check -j 6 -k ; then
_print_test_logs "first-test" _print_test_logs "first-test"
echo ">>>> RUN SECOND TEST (start)" echo ">>>> RUN SECOND TEST (start)"
NMTST_DEBUG="debug,TRACE,no-expect-message" make check -k || : NMTST_DEBUG="debug,TRACE,no-expect-message" make check -k || :
echo ">>>> RUN SECOND TEST (done)" echo ">>>> RUN SECOND TEST (done)"
_print_test_logs "second-test" _print_test_logs "second-test"
die "test failed" die "autotools test failed"
fi fi
if _with_valgrind; then if _with_valgrind; then
if ! NMTST_USE_VALGRIND=1 make check -j 3 -k ; then if ! NMTST_USE_VALGRIND=1 make check -j 3 -k ; then
_print_test_logs "(valgrind test)" _print_test_logs "(valgrind test)"
die "valgrind test failed" die "autotools+valgrind test failed"
fi fi
fi fi
popd popd
@@ -267,12 +264,18 @@ run_meson() {
ninja -C build ninja -C build
ninja -C build install 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 _with_valgrind; then
if ! NMTST_USE_VALGRIND=1 ninja -C build test; then if ! NMTST_USE_VALGRIND=1 ninja -C build test; then
_print_test_logs "(valgrind test)" _print_test_logs "(valgrind test)"
die "valgrind test failed" die "meson+valgrind test failed"
fi fi
fi fi
} }