tests/test_first_look_rebuild.py: stub the three report tools first_look.ps1 runs, and check they are called (TEST-1421) (OLD-9942) #669

Merged
leonida/mandy
LouisRiverstone merged 2 commits from carry-old-9942 into main 2026-11-28 18:52:20 +00:00

Pull request successfully merged and closed

LouisRiverstone commented 2026-11-24 11:18:59 +00:00

Claimed in the coordination issue as: OLD-9942 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129925439)

Replaces the carried-over draft #209. I'm the original author of old upstream PR 9942.

What and why

TEST-1421. The rebuild test stubs gdk_runtime_calls.py, find_hash_lookup.py and exe_checklist.py, the three report tools scripts/first_look.ps1 runs after pe_inspect. On main, two of those stubs do nothing at all, so the test can't tell whether the script ran them. Now all three use one stub. It records its name in tools_called.txt and writes the file its --json/--out names, using newline="\n" (pointed out by tikD1337 on the old PR). The test then asserts that the script called the three tools, in order. This tightens an existing test; it doesn't fix a failure.

The old branch's final diff, applied on current main (21625bca8) as one commit. It applied cleanly.

Tested

The test is Windows-only (skipUnless(os.name == "nt")). On Linux it reports 5 skipped. I ran it with Windows Python 3.11 and Windows PowerShell 5.1 (Windows 11, from WSL) on an export of tests/, scripts/ and tools/:

  • main: 5 tests OK
  • this branch: 5 tests OK, including the new assertion that the three tools were called

GPUs tested: n/a

AI-assisted: yes (Claude Code)

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. (n/a: test only)
Claimed in the coordination issue as: OLD-9942 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129925439) Replaces the carried-over draft #209. I'm the original author of old upstream PR 9942. ### What and why TEST-1421. The rebuild test stubs `gdk_runtime_calls.py`, `find_hash_lookup.py` and `exe_checklist.py`, the three report tools `scripts/first_look.ps1` runs after `pe_inspect`. On `main`, two of those stubs do nothing at all, so the test can't tell whether the script ran them. Now all three use one stub. It records its name in `tools_called.txt` and writes the file its `--json`/`--out` names, using `newline="\n"` (pointed out by tikD1337 on the old PR). The test then asserts that the script called the three tools, in order. This tightens an existing test; it doesn't fix a failure. The old branch's final diff, applied on current `main` (21625bca8) as one commit. It applied cleanly. ### Tested The test is Windows-only (`skipUnless(os.name == "nt")`). On Linux it reports 5 skipped. I ran it with Windows Python 3.11 and Windows PowerShell 5.1 (Windows 11, from WSL) on an export of `tests/`, `scripts/` and `tools/`: - `main`: 5 tests OK - this branch: 5 tests OK, including the new assertion that the three tools were called GPUs tested: n/a AI-assisted: yes (Claude Code) ### 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. (n/a: test only)
lixonik reviewed 2026-11-24 11:27:37 +00:00
lixonik left a comment
No description provided.
Independent verification at `fbde4721` with Windows PowerShell 5.1: `python -I tests/test_first_look_rebuild.py -v` passed all five tests on both the base and the PR head. In synthetic controls, removing each of the three report-tool calls individually failed the new assertion, and swapping the first two report calls also failed it. The original test passed with the hash-lookup call omitted. AI-assisted testing.
MoonEyes commented 2026-11-28 18:52:17 +00:00

Red/green: No red test; this tests-only PR's tests/test_first_look_rebuild.py passes 5/5 on main and with the PR, natively on Windows (skipped on GitHub Actions Linux, which has no powershell.exe).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: No red test; this tests-only PR's tests/test_first_look_rebuild.py passes 5/5 on main and with the PR, natively on Windows (skipped on GitHub Actions Linux, which has no powershell.exe). Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.