feat(compass-app): multi-window gtk3 e2e smoke gate (SEA-2035 M4) - #369
Open
rigel-mintaka wants to merge 1 commit into
Open
feat(compass-app): multi-window gtk3 e2e smoke gate (SEA-2035 M4)#369rigel-mintaka wants to merge 1 commit into
rigel-mintaka wants to merge 1 commit into
Conversation
rigel-mintaka
force-pushed
the
seal-2035-mw-m4-smoke-gate
branch
3 times, most recently
from
August 17, 2026 18:34
295eb7e to
a72e6e2
Compare
The multi-window smoke gate (design record compass-multi-window §M4): the ONE
test that drives the REAL GTK3/WebKit Wails shell — the window factory, real
application.Window handles, and a real WindowClosing event — rather than the
windowDispatcher seam's fakes.
TestMultiWindowCloseCancelsOnlyClosingWindowE2E boots two real Bridge windows
through the production newAppWindow factory, registers an in-flight bridge call
for each through the real capture path (a ctx carrying application.WindowKey, so
register → windowFromContext stores a real wailsWindowDispatcher{win}), closes
one window for real, and asserts its WindowClosing handler ran cancelWindow and
swept ONLY that window's call while the other survives. This closes the
architecturally-forced test gap the M3/M3b reviews flagged: windowFromContext
returns nil in the nogtk3 unit build, so the unit suite injects call.window by
hand and never fires a real close — the daemon-observable leak gate
(subscriptions terminate on window close) was untested end to end until here.
The GTK loop owns the main goroutine (TestMain hosts app.Run; the Test body
runs on a driver goroutine gated on ApplicationStarted); the gate self-skips
with no display, so a container-less sandbox skips rather than fails. Event-
gated, no sleeps.
CI: a dedicated, affected-guarded ci.yml step — not a moon-battery task — is the
one CI lane that compiles + runs the native app. It runs only when a PR touches
go/cmd/compass-app/ (full sweep on push/schedule), realizing the GTK/WebKitGTK
toolchain out of band via tools/toolchain/gtk-e2e-env.nix (pinned to the same
devenv.lock nixpkgs the dev shell links against), so the per-PR moon battery
stays GTK-free. The GTK3/WebKitGTK package set is factored into
tools/toolchain/gtk-closure.nix, imported by both devenv.nix's PKG_CONFIG_PATH
and the e2e helper, so the two cannot drift. xvfb-run is added to the dev shell
(Linux-only, outside the parity-parsed packages literal).
The step realizes every helper output with `nix build`, never `nix eval`: the
helper exposes `bin` (xvfb-run + pkg-config), `pkgConfig` (a buildEnv over the
closure), and `cc` (the nixpkgs cc-wrapper). The dev shell can set a bare
PKG_CONFIG_PATH string because nix's string-context pulls those derivations into
the shell's input closure and builds them when direnv realizes the environment;
`nix eval --raw` strips that context, so a plain search-path string would name
`.pc` files nix never built and the cgo link fails "No package 'glib-2.0'
found". buildEnv makes the WebKitGTK closure a first-class build output whose
`.pc` files and the libraries they reference are realized as dependencies.
The cgo link uses that nixpkgs cc-wrapper (CC/CXX = cc.out's bin/cc,bin/c++),
NOT the runner's /usr/bin/gcc: WebKitGTK from this nixpkgs is built against glibc
2.42, so a stock runner's older system glibc fails to link libwebkit2gtk-4.1.so
("undefined reference to `__inet_pton_chk@GLIBC_2.42'"). The wrapper carries the
matching glibc and, through its binutils ld-wrapper, stamps the test binary's
ELF interpreter to that glibc's ld-linux and rpaths the store lib dirs — so the
binary is self-contained on a non-NixOS runner. This is the toolchain a dev box
links with implicitly, so CI now matches it byte-for-byte.
The gate is fail-closed on both ends: the affected guard fails LOUD if the base
ref does not resolve (rather than swallowing a git error as "not affected" and
skipping green), and the silent-no-op guard asserts the test PASSED — not merely
that `=== RUN` appeared, which a skip also prints — so a display bring-up
regression reds the lane instead of passing assertion-free. The Xvfb server log
goes to a dedicated file, not /dev/stdout, so it never collides with the step's
own stdout redirect and swallows the go-test output.
Spec-impact: None. Implements the frozen compass-multi-window §M4 gate; no
design-ledger row or contract change.
Ledger-impact: None.
Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
seal-2035-mw-m4-smoke-gate
branch
from
August 17, 2026 18:47
a72e6e2 to
d6db053
Compare
rigel-mintaka
force-pushed
the
seal-2035-mw-m3b-close-cancel
branch
from
August 17, 2026 18:48
e183165 to
224e9b2
Compare
|
Compass engineering docs preview: https://seal-2035-mw-m4-smoke-gate.compass-eng-docs.pages.dev Deployed from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of a stack containing 2 PRs:
mainThe multi-window smoke gate (design record compass-multi-window §M4): the ONE
test that drives the REAL GTK3/WebKit Wails shell — the window factory, real
application.Window handles, and a real WindowClosing event — rather than the
windowDispatcher seam's fakes.
TestMultiWindowCloseCancelsOnlyClosingWindowE2E boots two real Bridge windows
through the production newAppWindow factory, registers an in-flight bridge call
for each through the real capture path (a ctx carrying application.WindowKey, so
register → windowFromContext stores a real wailsWindowDispatcher{win}), closes
one window for real, and asserts its WindowClosing handler ran cancelWindow and
swept ONLY that window's call while the other survives. This closes the
architecturally-forced test gap the M3/M3b reviews flagged: windowFromContext
returns nil in the nogtk3 unit build, so the unit suite injects call.window by
hand and never fires a real close — the daemon-observable leak gate
(subscriptions terminate on window close) was untested end to end until here.
The GTK loop owns the main goroutine (TestMain hosts app.Run; the Test body
runs on a driver goroutine gated on ApplicationStarted); the gate self-skips
with no display, so a container-less sandbox skips rather than fails. Event-
gated, no sleeps.
CI: a dedicated, affected-guarded ci.yml step — not a moon-battery task — is the
one CI lane that compiles + runs the native app. It runs only when a PR touches
go/cmd/compass-app/ (full sweep on push/schedule), realizing the WebKitGTK
cgo-link closure + xvfb-run out of band via tools/toolchain/gtk-e2e-env.nix
(pinned to the same devenv.lock nixpkgs the dev shell links against), so the
per-PR moon battery stays GTK-free. The GTK3/WebKitGTK package set is factored
into tools/toolchain/gtk-closure.nix, imported by both devenv.nix's
PKG_CONFIG_PATH and the e2e helper, so the two cannot drift. xvfb-run is added
to the dev shell (Linux-only, outside the parity-parsed packages literal).
Spec-impact: None. Implements the frozen compass-multi-window §M4 gate; no
design-ledger row or contract change.
Ledger-impact: None.
Co-authored-by: Matt Wilkinson matt@rigel.build