diff options
| author | Jolymmiles <75259437+Jolymmiles@users.noreply.github.com> | 2026-11-23 02:21:52 +0400 |
|---|---|---|
| committer | Jolymmiles <75259437+Jolymmiles@users.noreply.github.com> | 2026-11-23 02:21:52 +0400 |
| commit | f02e952272c7fcbb7773bb3e3b83e42fec7bc754 (patch) | |
| tree | bd65791216bf6a7dc175b6fcb5614ba1e4a6d484 /scripts/ci_expected_failures.py | |
| parent | aa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff) | |
CI: a macOS (Apple Silicon) job for the runtime on MoltenVK and the Python suites
runtime.yml gets a macos job on macos-26: Homebrew's MoltenVK, Vulkan headers and
loader, llvm-mc, SPIRV-Tools and glslang; the runtime built through sccache; ctest
and run_gpu_tests.py on MoltenVK. ci.yml gets macos-python: the standard-library
loop, the semantic suite alongside it, and the pytest files with Homebrew's llvm-mc.
The hosted runner's Metal device is Apple Paravirtual device (family Mac2), which
MoltenVK runs on; KosmicKrisp finds no device there. macos-15 can't build the
runtime (Xcode 16's libc++ has no floating-point std::from_chars).
The two tests that fail on MoltenVK today, also on an M3 Max, are listed with the
pull requests that fix them (xdxr_build_check: #2423, ps_ssharp: #1845);
scripts/ci_expected_failures.py fails the step on any other failure and notes an
expected one that passes.
Diffstat (limited to 'scripts/ci_expected_failures.py')
| -rw-r--r-- | scripts/ci_expected_failures.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/ci_expected_failures.py b/scripts/ci_expected_failures.py new file mode 100644 index 000000000..13dce177d --- /dev/null +++ b/scripts/ci_expected_failures.py | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | """Judge a CI test run that has known failures, each fixed by an open pull request. | ||
| 2 | |||
| 3 | python -I scripts/ci_expected_failures.py FAILED_LIST EXIT_STATUS [EXPECTED ...] | ||
| 4 | |||
| 5 | FAILED_LIST is a file with one failed test name per line, EXIT_STATUS the test runner's exit status, and each | ||
| 6 | EXPECTED argument one or more whitespace-separated test names (so a workflow can pass one quoted list). Exits 1 when a | ||
| 7 | test outside EXPECTED failed, or when the runner failed without naming a test (a crash, a build error). An expected | ||
| 8 | failure that passed gets a GitHub Actions notice, so the list in the workflow can shrink. | ||
| 9 | """ | ||
| 10 | |||
| 11 | import sys | ||
| 12 | |||
| 13 | |||
| 14 | def judge(failed: list[str], status: int, expected: list[str]) -> tuple[int, list[str]]: | ||
| 15 | """(exit status, GitHub Actions workflow commands to print).""" | ||
| 16 | unexpected = [name for name in failed if name not in expected] | ||
| 17 | lines = [f"::error::{name} failed" for name in unexpected] | ||
| 18 | if status != 0 and not failed: | ||
| 19 | lines.append(f"::error::the test runner exited with {status} without naming a failed test") | ||
| 20 | for name in expected: | ||
| 21 | if name in failed: | ||
| 22 | lines.append(f"::warning::{name} failed, as expected until its fix is merged") | ||
| 23 | else: | ||
| 24 | lines.append(f"::notice::{name} passed: drop it from the expected failures") | ||
| 25 | return (1 if unexpected or (status != 0 and not failed) else 0), lines | ||
| 26 | |||
| 27 | |||
| 28 | def main(argv: list[str]) -> int: | ||
| 29 | if len(argv) < 2: | ||
| 30 | print(__doc__.strip(), file=sys.stderr) | ||
| 31 | return 2 | ||
| 32 | with open(argv[0], encoding="utf-8") as f: | ||
| 33 | failed = [line.strip() for line in f if line.strip()] | ||
| 34 | expected = [name for arg in argv[2:] for name in arg.split()] | ||
| 35 | code, lines = judge(failed, int(argv[1]), expected) | ||
| 36 | print("\n".join(lines)) | ||
| 37 | return code | ||
| 38 | |||
| 39 | |||
| 40 | if __name__ == "__main__": | ||
| 41 | sys.exit(main(sys.argv[1:])) | ||