1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

CI: improve the intermittent ignore

This commit is contained in:
Sylvestre Ledru 2025-03-07 10:03:59 +01:00
parent 0936cee9d5
commit 55bedbb68e
2 changed files with 20 additions and 4 deletions

View file

@ -340,9 +340,14 @@ jobs:
# Compare root tests # Compare root tests
compare_tests '${{ steps.vars.outputs.path_GNU_tests }}/test-suite-root.log' "${ROOT_REF_LOG_FILE}" "root" compare_tests '${{ steps.vars.outputs.path_GNU_tests }}/test-suite-root.log' "${ROOT_REF_LOG_FILE}" "root"
# Set environment variable to indicate whether all failures are intermittent
if [ -n "${have_new_failures}" ]; then if [ -n "${have_new_failures}" ]; then
echo "::error ::Found new test failures" echo "ONLY_INTERMITTENT=false" >> $GITHUB_ENV
echo "::error ::Found new non-intermittent test failures"
exit 1 exit 1
else
echo "ONLY_INTERMITTENT=true" >> $GITHUB_ENV
echo "::notice ::No new test failures detected"
fi fi
- name: Upload comparison log (for GnuComment workflow) - name: Upload comparison log (for GnuComment workflow)
if: success() || failure() # run regardless of prior step success/failure if: success() || failure() # run regardless of prior step success/failure

View file

@ -2,7 +2,8 @@
""" """
Compare the current results to the last results gathered from the main branch to highlight Compare the current results to the last results gathered from the main branch to highlight
if a PR is making the results better/worse if a PR is making the results better/worse.
Don't exit with error code if all failing tests are in the ignore-intermittent.txt list.
""" """
import json import json
@ -10,6 +11,7 @@ import sys
from os import environ from os import environ
REPO_DEFAULT_BRANCH = environ.get("REPO_DEFAULT_BRANCH", "main") REPO_DEFAULT_BRANCH = environ.get("REPO_DEFAULT_BRANCH", "main")
ONLY_INTERMITTENT = environ.get("ONLY_INTERMITTENT", "false")
NEW = json.load(open("gnu-result.json")) NEW = json.load(open("gnu-result.json"))
OLD = json.load(open("main-gnu-result.json")) OLD = json.load(open("main-gnu-result.json"))
@ -29,9 +31,18 @@ print(
f"::warning ::Changes from '{REPO_DEFAULT_BRANCH}': PASS {pass_d:+d} / FAIL {fail_d:+d} / ERROR {error_d:+d} / SKIP {skip_d:+d} " f"::warning ::Changes from '{REPO_DEFAULT_BRANCH}': PASS {pass_d:+d} / FAIL {fail_d:+d} / ERROR {error_d:+d} / SKIP {skip_d:+d} "
) )
# If results are worse fail the job to draw attention # If results are worse, check if we should fail the job
if pass_d < 0: if pass_d < 0:
print( print(
f"::error ::PASS count is reduced from '{REPO_DEFAULT_BRANCH}': PASS {pass_d:+d} " f"::error ::PASS count is reduced from '{REPO_DEFAULT_BRANCH}': PASS {pass_d:+d} "
) )
sys.exit(1)
# Check if all failing tests are intermittent based on the environment variable
only_intermittent = ONLY_INTERMITTENT.lower() == 'true'
if only_intermittent:
print("::notice ::All failing tests are in the ignored intermittent list")
print("::notice ::Not failing the build")
else:
print("::error ::Found non-ignored failing tests")
sys.exit(1)