upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts/ci_expected_failures.py
diff options
context:
space:
mode:
authorSolthodox <100046219+Solthodox@users.noreply.github.com>2026-11-23 16:59:55 +0100
committerGitHub <noreply@github.com>2026-11-23 09:59:55 -0600
commitd8a9bdac18ba263c1e2d87536cb3f275c9ce69f2 (patch)
tree0de8eb88d2e7ede4c32a302ea3375b842efde380 /scripts/ci_expected_failures.py
parent1a9c8c9e8983525bd1e3b013e59a5d804ed7000c (diff)
ci: fail interrupted test runs even when partial failures are expected (#6755)
Squash-merged after diff review of PR #6755 - ci: keep interrupted runs red when partial failures are allowlisted
Diffstat (limited to 'scripts/ci_expected_failures.py')
-rw-r--r--scripts/ci_expected_failures.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/ci_expected_failures.py b/scripts/ci_expected_failures.py
index 2e8fafb20..8112dcf4b 100644
--- a/scripts/ci_expected_failures.py
+++ b/scripts/ci_expected_failures.py
@@ -4,9 +4,9 @@
4 4
5FAILED_LIST is a file with one failed test name per line, EXIT_STATUS the test runner's exit status, and each 5FAILED_LIST is a file with one failed test name per line, EXIT_STATUS the test runner's exit status, and each
6EXPECTED argument one or more whitespace-separated test names (so a workflow can pass one quoted list). Exits 1 when a 6EXPECTED argument one or more whitespace-separated test names (so a workflow can pass one quoted list). Exits 1 when a
7test outside EXPECTED failed, or when the runner failed without naming a test (a crash, a build error); 2 on a usage 7test outside EXPECTED failed, the runner failed without naming a test, or the runner was terminated by a signal
8error, including a non-integer EXIT_STATUS or a FAILED_LIST that cannot be read, reported as one line. `--help` prints 8(its failure list can be incomplete); 2 on a usage error. `--help` prints this text. An expected failure absent
9this text. An expected failure that passed gets a GitHub Actions notice, so the list in the workflow can shrink. 9from a completed run gets a GitHub Actions notice so the list in the workflow can shrink.
10""" 10"""
11 11
12import sys 12import sys
@@ -16,6 +16,10 @@ def judge(failed: list[str], status: int, expected: list[str]) -> tuple[int, lis
16 """(exit status, GitHub Actions workflow commands to print).""" 16 """(exit status, GitHub Actions workflow commands to print)."""
17 unexpected = [name for name in failed if name not in expected] 17 unexpected = [name for name in failed if name not in expected]
18 lines = [f"::error::{name} failed" for name in unexpected] 18 lines = [f"::error::{name} failed" for name in unexpected]
19 # subprocess reports a signal as -N; the shell pipelines in runtime.yml report it as 128+N.
20 if status < 0 or 128 < status <= 255:
21 lines.append(f"::error::abnormal test runner exit {status}; the failure list may be incomplete")
22 return 1, lines
19 if status != 0 and not failed: 23 if status != 0 and not failed:
20 lines.append(f"::error::the test runner exited with {status} without naming a failed test") 24 lines.append(f"::error::the test runner exited with {status} without naming a failed test")
21 for name in expected: 25 for name in expected: