]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
rerun failing tests with -v
authorEric Covener <covener@apache.org>
Sun, 19 Mar 2023 21:04:00 +0000 (21:04 +0000)
committerEric Covener <covener@apache.org>
Sun, 19 Mar 2023 21:04:00 +0000 (21:04 +0000)
Submitted by: covener

Github: closes #349

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908531 13f79535-47bb-0310-9956-ffa450edef68

test/travis_run_linux.sh

index 1dc64871d48b64e61e34ba77a6949549be01d9a0..c2ae092954a6308f3c2179c953e3e7090d339a63 100755 (executable)
@@ -119,14 +119,44 @@ if ! test -v SKIP_TESTING; then
 
     if ! test -v NO_TEST_FRAMEWORK; then
         if test -v WITH_TEST_SUITE; then
-            make check TESTS="${TESTS}" TEST_CONFIG="${TEST_ARGS}"
-            RV=$?
+            make check TESTS="${TESTS}" TEST_CONFIG="${TEST_ARGS}" | tee test.log
+            RV=${PIPESTATUS[0]}
+            # re-run failing tests with -v, avoiding set -e
+            if [ $RV -ne 0 ]; then
+                # mv test/perl-framework/t/logs/error_log test/perl-framework/t/logs/error_log_save
+                FAILERS=""
+                while read FAILER; do
+                    FAILERS="$FAILERS $FAILER"
+                done < <(awk '/Failed:/{print $1}' test.log)
+                if [ -n "$FAILERS" ]; then
+                    t/TEST -v $FAILERS || true
+                fi
+                # set -e would have killed us after the original t/TEST
+                rm -f test.log
+                # mv test/perl-framework/t/logs/error_log_save test/perl-framework/t/logs/error_log
+                false
+            fi
         else
             test -v TEST_INSTALL || make install
             pushd test/perl-framework
                 perl Makefile.PL -apxs $PREFIX/bin/apxs
-                make test APACHE_TEST_EXTRA_ARGS="${TEST_ARGS} ${TESTS}"
-                RV=$?
+                make test APACHE_TEST_EXTRA_ARGS="${TEST_ARGS} ${TESTS}" | tee test.log
+                RV=${PIPESTATUS[0]}
+                # re-run failing tests with -v, avoiding set -e
+                if [ $RV -ne 0 ]; then
+                    # mv t/logs/error_log t/logs/error_log_save
+                    FAILERS=""
+                    while read FAILER; do
+                        FAILERS="$FAILERS $FAILER"
+                    done < <(awk '/Failed:/{print $1}' test.log)
+                    if [ -n "$FAILERS" ]; then
+                        t/TEST -v $FAILERS || true
+                    fi
+                    # set -e would have killed us after the original t/TEST
+                    rm -f test.log
+                    # mv t/logs/error_log_save t/logs/error_log
+                    false
+                fi
             popd
         fi