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

Merged
kotekompotek merged 2 commits from upstream-pr/342 into main 2026-11-28 14:47:45 +00:00
kotekompotek commented 2026-11-24 03:31:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-24T03:31:02Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465551544 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/342). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-24T03:31:02Z. --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Oliwettoo on 2026-11-24T10:26:49Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7128792159 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/342#issuecomment-7128792159). Originally posted by [Oliwettoo](https://github.com/Oliwettoo) on 2026-11-24T10:26:49Z. --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-25T07:52:23Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7156347031 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/342#issuecomment-7156347031). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T07:52:23Z. --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T14:47:42Z.


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)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7240935950 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/342#issuecomment-7240935950). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T14:47:42Z. --- 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 reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!342
No description provided.