Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/GnuTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,14 @@ jobs:
# Compare root tests
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
echo "::error ::Found new test failures"
echo "ONLY_INTERMITTENT=false" >> $GITHUB_ENV
echo "::error ::Found new non-intermittent test failures"
exit 1
else
echo "ONLY_INTERMITTENT=true" >> $GITHUB_ENV
echo "::notice ::No new test failures detected"
fi
- name: Upload comparison log (for GnuComment workflow)
if: success() || failure() # run regardless of prior step success/failure
Expand Down
17 changes: 14 additions & 3 deletions util/compare_gnu_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

"""
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 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"))
Expand All @@ -29,9 +31,18 @@
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)
Loading