[PR #1856] scripts/ci_expected_failures: detect Windows crash codes, dedup annotations, avoid blank stdout #1866

Open
opened 2026-11-26 21:19:13 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1856
Author: @kirigayakazima
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fix/ci-expected-failures-safety


📝 Commits (1)

  • 20764be Fix ci_expected_failures crash detection, dedup, and empty stdout

📊 Changes

2 files changed (+50 additions, -3 deletions)

View changed files

📝 scripts/ci_expected_failures.py (+7 -3)
📝 tests/test_ci_expected_failures.py (+43 -0)

📄 Description

Claimed in the coordination issue as: CI-EXPECTED-FAILURES-WINDOWS-CRASH-AND-DEDUP (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163483985)

What and why

  • Deduplicate failed and expected in insertion order inside judge() in scripts/ci_expected_failures.py so repeated test names or duplicate workflow arguments do not emit duplicate GitHub Actions workflow commands (::error::, ::warning::, ::notice::).
  • Broaden abnormal test-runner termination detection from 128 < status <= 255 to status < 0 or status > 128, catching unsigned Windows NTSTATUS / Win32 crash exit codes (such as 0xC0000005 / 3221225477 and 0xC00000FD / 3221225725) in addition to POSIX signal codes 128+N.
  • Print workflow command lines in main() only when lines is non-empty so clean runs emit empty stdout instead of a stray blank line.
  • Add regression unit tests in tests/test_ci_expected_failures.py covering Windows NTSTATUS exit codes, order-preserving deduplication, and clean main() stdout output.

Tested

  • Patched: python -I tests/test_ci_expected_failures.py -v -> Ran 17 tests in 0.054s (OK).
  • Baseline check (upstream/main 98c2f777 with updated tests copied into detached worktree): Ran 17 tests in 0.059s (FAILED (failures=3) on all 3 new regression tests).
  • Repo gates: python -I tests/test_ci_registration.py (Ran 16 tests in 5.226s, OK), python -I tests/test_text_write_line_endings.py (Ran 3 tests in 13.044s, OK), python -I scripts/check_no_game_data.py (exit 0), python -I -m compileall -q (exit 0), git diff --check (exit 0).

GPUs tested: n/a (host CI script and unittest coverage)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1856 **Author:** [@kirigayakazima](https://github.com/kirigayakazima) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/ci-expected-failures-safety` --- ### 📝 Commits (1) - [`20764be`](https://github.com/ubiquitarianism/leonida/commit/20764bee8580f0199bac619c06990060d4786153) Fix ci_expected_failures crash detection, dedup, and empty stdout ### 📊 Changes **2 files changed** (+50 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `scripts/ci_expected_failures.py` (+7 -3) 📝 `tests/test_ci_expected_failures.py` (+43 -0) </details> ### 📄 Description Claimed in the coordination issue as: CI-EXPECTED-FAILURES-WINDOWS-CRASH-AND-DEDUP (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163483985) ### What and why - Deduplicate `failed` and `expected` in insertion order inside `judge()` in `scripts/ci_expected_failures.py` so repeated test names or duplicate workflow arguments do not emit duplicate GitHub Actions workflow commands (`::error::`, `::warning::`, `::notice::`). - Broaden abnormal test-runner termination detection from `128 < status <= 255` to `status < 0 or status > 128`, catching unsigned Windows NTSTATUS / Win32 crash exit codes (such as `0xC0000005` / `3221225477` and `0xC00000FD` / `3221225725`) in addition to POSIX signal codes `128+N`. - Print workflow command lines in `main()` only when `lines` is non-empty so clean runs emit empty stdout instead of a stray blank line. - Add regression unit tests in `tests/test_ci_expected_failures.py` covering Windows NTSTATUS exit codes, order-preserving deduplication, and clean `main()` stdout output. ### Tested - Patched: `python -I tests/test_ci_expected_failures.py -v` -> `Ran 17 tests in 0.054s` (`OK`). - Baseline check (`upstream/main` `98c2f777` with updated tests copied into detached worktree): `Ran 17 tests in 0.059s` (`FAILED (failures=3)` on all 3 new regression tests). - Repo gates: `python -I tests/test_ci_registration.py` (`Ran 16 tests in 5.226s`, `OK`), `python -I tests/test_text_write_line_endings.py` (`Ran 3 tests in 13.044s`, `OK`), `python -I scripts/check_no_game_data.py` (exit 0), `python -I -m compileall -q` (exit 0), `git diff --check` (exit 0). GPUs tested: n/a (host CI script and unittest coverage) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1866
No description provided.