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

Open
github-bot wants to merge 2 commits from github-bot/gh-342 into main AGit
Owner

@⁠kotekompotek on GitHub · 2026-11-24 03:31 UTC · original
kotekompotek:work/test-hw-oracle-runner → main · +77 −1 · 2 files · 2 commits · open

Claimed in the coordination issue as: TEST-HW-ORACLE-RUNNER (#14)

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.
**@⁠kotekompotek** on GitHub · 2026-11-24 03:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/342) `kotekompotek:work/test-hw-oracle-runner` → `main` · +77 −1 · 2 files · 2 commits · open Claimed in the coordination issue as: TEST-HW-ORACLE-RUNNER (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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's Linux check of #342 caught test_is_msvc_recognizes_cl_variants
failing off Windows: os.path.basename does not split on backslash there.
Normalize separators in _is_msvc so a Windows-style path is recognized on
every host.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:54:20 +00:00
Author
Owner

@⁠Oliwettoo on GitHub · 2026-11-24 10:26 UTC · original

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.

**@⁠Oliwettoo** on GitHub · 2026-11-24 10:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/342#issuecomment-7128792159) 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.
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 07:52 UTC · original

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

**@⁠kotekompotek** on GitHub · 2026-11-25 07:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/342#issuecomment-7156347031) 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
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/342/head:github-bot/gh-342'
git switch 'github-bot/gh-342'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-342'
git switch 'github-bot/gh-342'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-342'
git switch 'github-bot/gh-342'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-342'
git switch 'main'
git merge --squash 'github-bot/gh-342'
git switch 'main'
git merge --ff-only 'github-bot/gh-342'
git switch 'main'
git merge 'github-bot/gh-342'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.