diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-29 04:47:44 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-29 04:47:44 -0400 |
| commit | 3ca9a9f17daa3d6258aa9f32a1a56a9f9e19642c (patch) | |
| tree | ef653ae4f4366afc9fe99c147035a9bd8bb6d416 /todo.org | |
| parent | 37d53dacf0636ae299b092b54dde78c0658a51c1 (diff) | |
| download | dotemacs-3ca9a9f17daa3d6258aa9f32a1a56a9f9e19642c.tar.gz dotemacs-3ca9a9f17daa3d6258aa9f32a1a56a9f9e19642c.zip | |
test: fix restart-emacs no-service mock to survive native-comp
test-system-cmd-restart-emacs-no-service-aborts mocked cj/system-cmd--emacs-service-available-p directly, but cj/system-cmd-restart-emacs reaches that helper through a native-comp intra-file direct call that bypasses the symbol-function redefinition. The mock silently no-opped, the real check ran, and on any machine that has emacs.service it returned non-nil, so restart proceeded and the should-error saw no error.
I mock executable-find to nil instead, driving the real helper to nil at a boundary its subr trampoline honors, matching the passing sibling tests. The test now passes whether or not emacs.service is installed.
Diffstat (limited to 'todo.org')
| -rw-r--r-- | todo.org | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -55,8 +55,9 @@ Tags are additive. For example, a small wrong-behavior fix can be =:bug:quick:=, and a feature that requires internal restructuring can be =:feature:refactor:=. * Emacs Open Work -** TODO [#C] restart-emacs no-service test fails on machines with emacs.service :test:bug: -=test-system-cmd-restart-emacs-no-service-aborts= (=tests/test-system-commands-resolve-and-run.el:172=) fails on velox and passes where no =emacs.service= exists. It mocks =cj/system-cmd--emacs-service-available-p= to return nil via =cl-letf=, but =cj/system-cmd-restart-emacs= (in =system-commands.el=, natively compiled) calls that helper through an intra-file direct reference in its =.eln=, which bypasses the symbol-function redefinition. So the real check runs, finds =emacs.service=, and restart proceeds instead of aborting -- the =should-error= sees "did not signal an error". Same native-comp mocking trap noted in CLAUDE.md, here for a same-file defun rather than a subr. Fix: mock at the boundary the helper uses (=executable-find= / the =systemctl= =call-process-shell-command=) the way the passing sibling tests =service-available-false-on-nonzero-exit= and =service-available-false-when-systemctl-absent= do, instead of mocking the helper directly; or inject the check. Pre-existing (fails on clean HEAD), surfaced during the 2026-06-29 structural speedrun. +** DONE [#C] restart-emacs no-service test fails on machines with emacs.service :test:bug: +CLOSED: [2026-06-29 Mon] +=test-system-cmd-restart-emacs-no-service-aborts= mocked =cj/system-cmd--emacs-service-available-p= directly, but =cj/system-cmd-restart-emacs= (natively compiled) reaches that helper through an intra-file direct reference in its =.eln= that bypasses the symbol-function redefinition, so the real check ran and passed on velox (which has =emacs.service=). Fixed by mocking at the boundary the helper uses (=executable-find= -> nil) instead of the helper itself, matching the passing sibling tests; the helper's =executable-find= call goes through a subr trampoline that honors =cl-letf=. 19/19 green. ** PROJECT [#A] Manual testing and validation Exercised once the phases above land. |
