[PR #1873] scripts/run_conservative_tier3_reference.ps1: validate prereqs, anchor ctest filter, guard stderr and env #1885

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

📋 Pull Request Information

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

Base: main ← Head: fix/run-conservative-tier3-safety


📝 Commits (1)

  • b63c28f Harden run_conservative_tier3_reference.ps1 prereq checks, ctest filter, and env handling

📊 Changes

2 files changed (+222 additions, -8 deletions)

View changed files

📝 scripts/run_conservative_tier3_reference.ps1 (+45 -8)
➕ tests/test_run_conservative_tier3_reference.py (+177 -0)

📄 Description

Claimed in the coordination issue as: RUN-CONSERVATIVE-TIER3-REF-PS1-SAFETY-AND-TESTS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7164301040)

What and why

  • Check for cmake and ctest upfront via Get-Command in scripts/run_conservative_tier3_reference.ps1 so a missing ctest fails before configuring and building runtime.
  • Wrap native cmake / ctest invocations in Invoke-Native with temporary $ErrorActionPreference = "Continue" so benign stderr warnings never raise NativeCommandError under strict error policies while non-zero exit codes still fail cleanly with their exit status.
  • Pass --no-tests=error and anchored exact test filter ^d3d12_conservative_tier3_reference$ to ctest so zero matched tests cannot silently pass.
  • Track $hadPreviousFilter = Test-Path Env:LEONIDA_VK_DEVICE and trim non-empty -Device before invoking ctest, restoring exact prior variable presence/value in finally. Preserve CRLF line endings (PS1_CRLF=68, PS1_LF_ONLY=0).
  • Add regression coverage using temporary PATH shims in tests/test_run_conservative_tier3_reference.py.

Tested

  • Patched: python -I tests/test_run_conservative_tier3_reference.py -v -> Ran 3 tests in 3.279s (OK).
  • Baseline check (upstream/main 5e95fa2f with tests/test_run_conservative_tier3_reference.py copied into detached worktree): Ran 3 tests in 2.800s (FAILED (failures=1, errors=3)).
  • Repo gates: PS1_CRLF=68 PS1_LF_ONLY=0, python -I tests/test_ci_registration.py (Ran 16 tests in 5.041s, OK), python -I tests/test_text_write_line_endings.py (Ran 3 tests in 12.657s, 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 (PowerShell runner prerequisite, ctest filter, and environment isolation tests)

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/1873 **Author:** [@kirigayakazima](https://github.com/kirigayakazima) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/run-conservative-tier3-safety` --- ### 📝 Commits (1) - [`b63c28f`](https://github.com/ubiquitarianism/leonida/commit/b63c28f6785a94e3ea0da42ea0be14be98ddf8e7) Harden run_conservative_tier3_reference.ps1 prereq checks, ctest filter, and env handling ### 📊 Changes **2 files changed** (+222 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `scripts/run_conservative_tier3_reference.ps1` (+45 -8) ➕ `tests/test_run_conservative_tier3_reference.py` (+177 -0) </details> ### 📄 Description Claimed in the coordination issue as: RUN-CONSERVATIVE-TIER3-REF-PS1-SAFETY-AND-TESTS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7164301040) ### What and why - Check for `cmake` and `ctest` upfront via `Get-Command` in `scripts/run_conservative_tier3_reference.ps1` so a missing `ctest` fails before configuring and building `runtime`. - Wrap native `cmake` / `ctest` invocations in `Invoke-Native` with temporary `$ErrorActionPreference = "Continue"` so benign stderr warnings never raise `NativeCommandError` under strict error policies while non-zero exit codes still fail cleanly with their exit status. - Pass `--no-tests=error` and anchored exact test filter `^d3d12_conservative_tier3_reference$` to `ctest` so zero matched tests cannot silently pass. - Track `$hadPreviousFilter = Test-Path Env:LEONIDA_VK_DEVICE` and trim non-empty `-Device` before invoking `ctest`, restoring exact prior variable presence/value in `finally`. Preserve CRLF line endings (`PS1_CRLF=68, PS1_LF_ONLY=0`). - Add regression coverage using temporary `PATH` shims in `tests/test_run_conservative_tier3_reference.py`. ### Tested - Patched: `python -I tests/test_run_conservative_tier3_reference.py -v` -> `Ran 3 tests in 3.279s` (`OK`). - Baseline check (`upstream/main` `5e95fa2f` with `tests/test_run_conservative_tier3_reference.py` copied into detached worktree): `Ran 3 tests in 2.800s` (`FAILED (failures=1, errors=3)`). - Repo gates: `PS1_CRLF=68 PS1_LF_ONLY=0`, `python -I tests/test_ci_registration.py` (`Ran 16 tests in 5.041s`, `OK`), `python -I tests/test_text_write_line_endings.py` (`Ran 3 tests in 12.657s`, `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 (PowerShell runner prerequisite, ctest filter, and environment isolation tests) 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#1885
No description provided.