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

@ -2,7 +2,8 @@
"""
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
@ -10,6 +11,7 @@ import sys
from os import environ
REPO_DEFAULT_BRANCH = environ.get("REPO_DEFAULT_BRANCH", "main")
ONLY_INTERMITTENT = environ.get("ONLY_INTERMITTENT", "false")
NEW = json.load(open("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} "
)
# 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:
print(
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)