test: unit tests for tools/hw_oracle/runner.py #342

Merged
leonida/mandy
kotekompotek merged 2 commits from work/test-hw-oracle-runner into main 2026-11-28 14:47:45 +00:00

Pull request successfully merged and closed

kotekompotek commented 2026-11-24 03:31:02 +00:00

Claimed in the coordination issue as: TEST-HW-ORACLE-RUNNER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140050149)

What and why

  • Rebased onto current main.
  • Added unit tests for tools/hw_oracle/runner.py in tests/test_hw_oracle_runner.py.

Tested

  • python -m pytest tests/test_hw_oracle_runner.py passed after rebasing onto current main.

GPUs tested: n/a

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.
Claimed in the coordination issue as: TEST-HW-ORACLE-RUNNER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140050149) ### What and why - Rebased onto current `main`. - Added unit tests for `tools/hw_oracle/runner.py` in `tests/test_hw_oracle_runner.py`. ### Tested - `python -m pytest tests/test_hw_oracle_runner.py` passed after rebasing onto current `main`. GPUs tested: n/a 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.
Oliwettoo commented 2026-11-24 10:26:49 +00:00

One test fails off Windows: test_is_msvc_recognizes_cl_variants asserts runner._is_msvc(r"C:\VS\cl.exe"), but on Linux and macOS os.path.basename doesn't split on \, so it returns the whole string and the test fails (reproduced on Linux, Python 3.13). Use os.path.join("VS", "cl.exe") in the test, or keep the Windows path and skip it with @unittest.skipUnless(os.name == "nt", …). The other 6 tests pass. No claim in #14 either. AI-assisted review.

One test fails off Windows: `test_is_msvc_recognizes_cl_variants` asserts `runner._is_msvc(r"C:\VS\cl.exe")`, but on Linux and macOS `os.path.basename` doesn't split on `\`, so it returns the whole string and the test fails (reproduced on Linux, Python 3.13). Use `os.path.join("VS", "cl.exe")` in the test, or keep the Windows path and skip it with `@unittest.skipUnless(os.name == "nt", …)`. The other 6 tests pass. No claim in #14 either. AI-assisted review.
kotekompotek commented 2026-11-25 07:52:23 +00:00

Fixed in c9e1bffe5: _is_msvc now normalizes \ to / before os.path.basename, so C:\VS\cl.exe is recognized on any host and the test passes off Windows without a skip. python -I tests/test_hw_oracle_runner.py: 7/7 OK.

AI-assisted: yes

Fixed in `c9e1bffe5`: `_is_msvc` now normalizes `\` to `/` before `os.path.basename`, so `C:\VS\cl.exe` is recognized on any host and the test passes off Windows without a skip. `python -I tests/test_hw_oracle_runner.py`: 7/7 OK. AI-assisted: yes
MoonEyes commented 2026-11-28 14:47:42 +00:00

Red/green: test_hw_oracle_runner.py failed one real assertion (a Windows path to cl.exe not recognized as MSVC) on main and passes with the backslash-normalizing fix.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 4f9199d09 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: test_hw_oracle_runner.py failed one real assertion (a Windows path to cl.exe not recognized as MSVC) on main and passes with the backslash-normalizing fix. Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 4f9199d09 in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.