test(menu): the menu-keys check compiles again, and closes the menu after Menu shortcut changes #2176
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2176
Loading…
Reference in a new issue
No description provided.
Delete branch "dazemc/Longshot:test/issue2127-menu-shortcut-close"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
tests/test_menu_keys.pydoes not compile onmain@9e10f6f7: it stops aterror: redefinition of 'std::mutex options_save_mu'before a single case is built, so a red check has been sitting onmainsince #2126 and #2171 each added that declaration to the check's fixture (one beside themenu_tickstubs, one besidesave()'s). This keeps one, besidesave(), which takes that lock. The check runs again.It also pins what #2127 reports: the menu could not be closed after Menu shortcut was changed from Esc to "Insert or F1", then to "F1 only". The tick's close path is not where a press can stay eaten: the branches that spend one (a pending restart's question, the debug warning, a text field) each end on the next press, and the row takes no restart. The new case drives the real key poll and close path for each of the row's three values, right after the value changes, with the queued press Windows uses and the polled one: F1 always closes; Insert closes unless the row is "F1 only", where Insert is left to an overlay by design.
A reviewer reads
tests/test_menu_keys.py:test_menu_shortcut_closes(the new case) and the fixture line that is no longer declared twice.Test-only: it changes no binary. Nothing here runs in the game; the in-game rule does not apply. See #2127: its comment has the report's root cause, the game's own pause menu and the keys controller software synthesizes (#1992, #1563), which this commit does not touch.
Testing
Tested: Linux, g++ (the check compiles its own fixture; no GPU and no game run: no binary changes).
tests/test_menu_keys.pypasses: 7 PASS lines, the new one beingPASS: after changing Menu shortcut, every shortcut the row offers closes the open menu. The same run throughabrun.sh, once the shared lock freed, printed the same 7 lines, with the menu checks that read the same sources beside it (the run); the branch now sits ona2dc5385, whose diff touches none of the files this check reads, and the full suite in the checklist re-rantests/test_menu_keys.pyon this head, where it passed. Onmain@9e10f6f7the same check does not compile, so it has no output at all:error: redefinition of 'std::mutex options_save_mu'.Negative control: with the close path's
press[0]dropped (the press eaten, as the report reads), the new case fails atFAIL:488 press(o, VK_INSERT, queued, true) == (mode == 1)— the first "open, then Insert" for "Insert or F1" and "Insert, F1 or Esc".The menu checks that read the same sources pass beside it:
test_menu_ini_keys,test_menu_hooks,test_menu_modules,test_menu_rows_model,test_menu_restart.What the focused set proves: the menu key poll and close path do what the new case says, and the new case fails when the close path does not answer to Insert (the negative control above). The rest of the suite is the run in the checklist.
Still to test: None.
Measurements
None: it changes no binary; the check's output on
main(does not compile) and here (7 PASS lines) is in Testing.Risks
Nothing a player sees: one test file, no game code, no build output, no options or saves. A revert is enough.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (mainhas 22 red checks at9e10f6f7(23 ata2dc5385);tests/test_menu_keys.pyis one of them, and this PR is its fix. Ran on this head in the slot, aftermise run test-deps, withLONGSHOT_SPIRV_HEADERS=_deps/spirv-headers/include LONGSHOT_VULKAN_HEADERS=_deps/vulkan-headers/include systemd-run --user --scope -p MemoryMax=12G -p MemorySwapMax=0 python3 -I -B tests/run_all.py --strict --jobs 5: 912 passed, 22 failed, 18 skipped in 395 s (linux, 5 at once). The 22 names are the refresh lane's cleana2dc5385baseline's 23 lesstests/test_menu_keys.py, an identical diff;tests/test_sim_turf_pools.pyandtests/test_switch_table.pystay red because #2202 and #2197 are not in this base.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.Assisted-by:/Co-Authored-By:trailers.Through
abrun.shonce the shared lock freed (another lane held it, thenrunall): the check and the menu checks that read the same sources, all passing.Negative control, run beside them: with the close path's
press[0]dropped, the new case fails atFAIL:488 press(o, VK_INSERT, queued, true) == (mode == 1).test(menu): the menu-keys check compiles again, and closes the menu after Menu shortcut changesto WIP: test(menu): the menu-keys check compiles again, and closes the menu after Menu shortcut changesWIP: the full suite is queued. The
mise run testbox is unticked: it is the whole suite, and only the focused set has run —tests/test_menu_keys.py(7 PASS lines, the new case among them) withtest_menu_ini_keys,test_menu_hooks,test_menu_modules,test_menu_rows_modelandtest_menu_restart, all throughabrun.sh(the run). That proves the menu key poll and close path, and that the new case fails when the close path does not answer to Insert (negative control above); it does not prove the rest.Still to test, by hand, before ready:
python3 -I -B tests/run_all.py --strict --jobs 8in a slot (8 jobs: on this PC the runner would start 32 and each check may compile), expecting this file to pass and nothing newly red againstmain's own reds — 22 at9e10f6f7, 23 ata2dc5385(the 23rd beingtests/test_sim_turf_pools.py). The description no longer claims the old 108, which was pre-#2171 drift.213dad6700c6484ead75WIP: test(menu): the menu-keys check compiles again, and closes the menu after Menu shortcut changesto test(menu): the menu-keys check compiles again, and closes the menu after Menu shortcut changesView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.