From 0af2c9bafbdc7f9ebf799bed230da832d5bb5cd4 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sun, 13 Feb 2022 21:46:45 -0600 Subject: [PATCH 1/2] maint/CICD ~ (GnuTests) display sub-step test comparison failures more prominently --- .github/workflows/GnuTests.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index eef8567c7..e901d4cfe 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -160,34 +160,38 @@ jobs: - name: Compare test failures VS reference shell: bash run: | + have_new_failures="" REF_LOG_FILE='${{ steps.vars.outputs.path_reference }}/test-logs/test-suite.log' REF_SUMMARY_FILE='${{ steps.vars.outputs.path_reference }}/test-summary/gnu-result.json' if test -f "${REF_LOG_FILE}"; then - echo "Reference SHA1/ID (of '${REF_SUMMARY_FILE}'): $(sha1sum -- "${REF_SUMMARY_FILE}")" + echo "Reference SHA1/ID: $(sha1sum -- "${REF_SUMMARY_FILE}")" REF_FAILING=$(sed -n "s/^FAIL: \([[:print:]]\+\).*/\1/p" "${REF_LOG_FILE}" | sort) NEW_FAILING=$(sed -n "s/^FAIL: \([[:print:]]\+\).*/\1/p" '${{ steps.vars.outputs.path_GNU_tests }}/test-suite.log' | sort) - for LINE in $REF_FAILING + for LINE in ${REF_FAILING} do - if ! grep -Fxq $LINE<<<"$NEW_FAILING"; then - echo "::warning ::Congrats! The gnu test $LINE is now passing!" + if ! grep -Fxq ${LINE}<<<"${NEW_FAILING}"; then + echo "::warning ::Congrats! The gnu test ${LINE} is now passing!" fi done - for LINE in $NEW_FAILING + for LINE in ${NEW_FAILING} do - if ! grep -Fxq $LINE<<<"$REF_FAILING" + if ! grep -Fxq ${LINE}<<<"${REF_FAILING}" then - echo "::error ::GNU test failed: $LINE. $LINE is passing on '${{ steps.vars.outputs.repo_default_branch }}'. Maybe you have to rebase?" + echo "::error ::GNU test failed: ${LINE}. ${LINE} is passing on '${{ steps.vars.outputs.repo_default_branch }}'. Maybe you have to rebase?" + have_new_failures="true" fi done else echo "::warning ::Skipping test failure comparison; no prior reference test logs are available." fi + if test -n "${have_new_failures}" ; then exit -1 ; fi - name: Compare test summary VS reference + if: success() || failure() # run regardless of prior step success/failure shell: bash run: | REF_SUMMARY_FILE='${{ steps.vars.outputs.path_reference }}/test-summary/gnu-result.json' if test -f "${REF_SUMMARY_FILE}"; then - echo "Reference SHA1/ID (of '${REF_SUMMARY_FILE}'): $(sha1sum -- "${REF_SUMMARY_FILE}")" + echo "Reference SHA1/ID: $(sha1sum -- "${REF_SUMMARY_FILE}")" mv "${REF_SUMMARY_FILE}" main-gnu-result.json python uutils/util/compare_gnu_result.py else From d6424bb354dced58cf314377db00ce2e6a847e99 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Wed, 16 Feb 2022 10:16:42 -0600 Subject: [PATCH 2/2] maint/util ~ remove extra/redundant factor tests for 'debug' builds - avoids "Terminated" timeout errors when using longer running 'debug' `factor` --- util/build-gnu.sh | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 2ab23ddc7..bb8d6e522 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -70,19 +70,38 @@ sed -i 's|^"\$@|/usr/bin/timeout 600 "\$@|' build-aux/test-driver sed -i "s/^[[:blank:]]*PATH=.*/ PATH='${UU_BUILD_DIR//\//\\/}\$(PATH_SEPARATOR)'\"\$\$PATH\" \\\/" Makefile sed -i 's| tr | /usr/bin/tr |' tests/init.sh make -j "$(nproc)" -# Generate the factor tests, so they can be fixed -# Used to be 36. Reduced to 20 to decrease the log size -for i in {00..20}; do - make "tests/factor/t${i}.sh" -done - -# strip the long stuff -for i in {21..36}; do +first=00 +if test ${UU_MAKE_PROFILE} != "debug"; then + # Generate the factor tests, so they can be fixed + # * reduced to 20 to decrease log size (down from 36 expected by GNU) + # * only for 'release', skipped for 'debug' as redundant and too time consuming (causing timeout errors) + seq=$( + i=${first} + while test "$i" -le 20; do + printf '%02d ' $i + i=$(($i + 1)) + done + ) + for i in ${seq}; do + make "tests/factor/t${i}.sh" + done + sed -i -e 's|^seq |/usr/bin/seq |' -e 's|sha1sum |/usr/bin/sha1sum |' tests/factor/t*sh + first=21 +fi +# strip all (debug) or just the longer (release) factor tests from Makefile +seq=$( + i=${first} + while test "$i" -le 36; do + printf '%02d ' $i + i=$(($i + 1)) + done +) +for i in ${seq}; do + echo "strip t${i}.sh from Makefile" sed -i -e "s/\$(tf)\/t${i}.sh//g" Makefile done grep -rl 'path_prepend_' tests/* | xargs sed -i 's| path_prepend_ ./src||' -sed -i -e 's|^seq |/usr/bin/seq |' -e 's|sha1sum |/usr/bin/sha1sum |' tests/factor/t*sh # Remove tests checking for --version & --help # Not really interesting for us and logs are too big