Skip to content

Commit 40d96aa

Browse files
committed
test(gui): doom config boot parity green; spacemacs GUI stays open
The empty-scratch wall was two bugs stacked, neither a rendering bug: 1. The probe fixture had unbalanced parens after string surgery — GNU failed to load it (end-of-file), the tick never armed, and every harness run timed out from a probe that was never running. The needle redesign (scan *Messages* for the framework's finish line, since minimal doom sets initial-scratch-message nil and ships no dashboard without a DOOMDIR) rides along in the rewritten fixture. 2. With the fixture loading, doom GUI parity passes in 15s — GNU and Neomacs boot the sealed doom fixture on isolated Xvfb, identical frame/buffer/visible-text state. Spacemacs GUI remains open, GNU-side only: in the harness GNU never opens its X connection (no socket fd; gmain/gdbus idle; pango parked) while the doom sibling passes on identical env and TUI spacemacs parity is green — a spacemacs-specific pre-display block to chase separately.
1 parent ffd0480 commit 40d96aa

2 files changed

Lines changed: 36 additions & 30 deletions

File tree

‎crates/neomacs-gui-tests/fixtures/config-env-boot.el‎

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
;;
33
;; Shared by the Doom and Spacemacs GUI comparisons: after the config
44
;; framework settles, dump the selected window's visible text and frame
5-
;; geometry to the artifacts the harness compares. Which buffer to wait
6-
;; for is passed in NEOMACS_GUI_CONFIG_HOME_NEEDLE (a string that must
7-
;; appear in the buffer name or its contents).
5+
;; geometry to the artifacts the harness compares. Which string to wait
6+
;; for is passed in NEOMACS_GUI_CONFIG_HOME_NEEDLE.
87

98
(require 'cl-lib)
109

@@ -18,30 +17,44 @@
1817
(visible (buffer-substring-no-properties
1918
(window-start) (window-end nil t)))
2019
(payload
21-
(format "{\"frame\":{\"cols\":%d,\"rows\":%d,\"pixel\":\"%dx%d\"},\
22-
\"buffer\":\"%s\",\"text\":%S}"
20+
(format "{\"frame\":{\"cols\":%d,\"rows\":%d,\"pixel\":\"%dx%d\"},\"buffer\":\"%s\",\"text\":%S}"
2321
(frame-width) (frame-height)
2422
(frame-pixel-width) (frame-pixel-height)
2523
(buffer-name buf) visible)))
2624
(when path
2725
(let ((coding-system-for-write 'utf-8))
2826
(with-temp-file path (insert payload))))))
2927

28+
(defun neomacs-config-boot--finished-p (needle)
29+
(or
30+
;; Some visible window names or shows the needle.
31+
(cl-some
32+
(lambda (window)
33+
(or (string-match-p needle (buffer-name (window-buffer window)))
34+
(cl-some (lambda (row)
35+
(and row (string-match-p needle row)))
36+
(split-string
37+
(buffer-substring-no-properties
38+
(window-start window) (window-end window t))
39+
"\n"))))
40+
(window-list))
41+
;; A config framework may legitimately leave every window empty (the
42+
;; minimal doom fixture sets initial-scratch-message nil and ships no
43+
;; dashboard without a DOOMDIR); its finish line in *Messages* is
44+
;; then the only observable startup signal. Verified on both editors:
45+
;; ISM=nil, scratch empty, "Doom loaded ..." in *Messages*.
46+
(and (get-buffer "*Messages*")
47+
(string-match-p
48+
needle
49+
(with-current-buffer "*Messages*"
50+
(buffer-substring-no-properties (point-min) (point-max)))))))
51+
3052
(defvar neomacs-config-boot--deadline nil)
3153

3254
(defun neomacs-config-boot--tick ()
3355
(let ((needle (or (getenv "NEOMACS_GUI_CONFIG_HOME_NEEDLE") "SPC")))
3456
(cond
35-
((cl-some
36-
(lambda (window)
37-
(or (string-match-p needle (buffer-name (window-buffer window)))
38-
(cl-some (lambda (row)
39-
(and row (string-match-p needle row)))
40-
(split-string
41-
(buffer-substring-no-properties
42-
(window-start window) (window-end window t))
43-
"\n"))))
44-
(window-list))
57+
((neomacs-config-boot--finished-p needle)
4558
;; Settle one more idle slice so deferred repaints land, then dump.
4659
(run-at-time
4760
2 nil
@@ -63,6 +76,5 @@
6376
(message "config boot timed out waiting for %S" needle)
6477
(let (kill-emacs-hook) (kill-emacs 1))))))
6578

66-
(setq neomacs-config-boot--deadline
67-
(time-add nil 240))
79+
(setq neomacs-config-boot--deadline (time-add nil 240))
6880
(run-at-time 3 nil #'neomacs-config-boot--tick)

‎crates/neomacs-gui-tests/tests/config_env_boot.rs‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,21 +141,10 @@ fn compare_config_boot(env: &dyn neomacs_infra::config_env::ConfigEnvironment, n
141141
);
142142
}
143143

144-
// Ignored while the probe design catches up with the finding: GNU GUI +
145-
// the sealed doom fixture boots doom successfully under Xvfb ("Doom
146-
// loaded 14 packages across 3 modules", pixel capture shows the themed
147-
// frame) -- but the minimal fixture doom (no DOOMDIR) sets
148-
// `initial-scratch-message' nil, so the selected window's text is
149-
// legitimately empty and a window-text needle can never fire. The
150-
// comparison needs a doom-GUI-state probe (dashboard buffer, modeline
151-
// face, or pixel-diff), not window text. Neomacs on the same fixture
152-
// shows the vanilla scratch text, which is itself a candidate
153-
// divergence to settle first.
154144
#[test]
155-
#[ignore = "probe design: window-text needle cannot fire on nil scratch; see comment"]
156145
fn doom_gui_boot_home_buffer_matches_gnu() {
157146
match neomacs_infra::DoomEnvironment::open() {
158-
Some(env) => compare_config_boot(&env, "Doom"),
147+
Some(env) => compare_config_boot(&env, "Doom loaded"),
159148
None => eprintln!(
160149
"skipping: no sealed Doom fixture; run \
161150
`cargo run -p xtask -- infra materialize doom`"
@@ -167,8 +156,13 @@ fn doom_gui_boot_home_buffer_matches_gnu() {
167156
// under Xvfb had not completed within 300s in the last harness run
168157
// (machine load ~35 during the chase; TUI boots in seconds). Re-run
169158
// on a quiet machine before concluding anything about spacemacs GUI.
159+
// GNU-side only: during the harness run GNU spacemacs never opens its X
160+
// connection (no socket fd; gmain/gdbus idle; the drawn screen observed
161+
// on the shared Xvfb is the Neomacs side). The doom sibling passes on
162+
// the identical env, so this is spacemacs-specific pre-display blocking,
163+
// not the harness. TUI spacemacs parity is green.
170164
#[test]
171-
#[ignore = "probe design: see doom sibling; also re-run on quiet machine"]
165+
#[ignore = "GNU spacemacs GUI blocks before opening X: live investigation"]
172166
fn spacemacs_gui_boot_home_buffer_matches_gnu() {
173167
match neomacs_infra::SpacemacsEnvironment::open() {
174168
Some(env) => compare_config_boot(&env, "Find File"),

0 commit comments

Comments
 (0)