Skip to content

feat(compass-app): multi-window gtk3 e2e smoke gate (SEA-2035 M4) - #369

Open
rigel-mintaka wants to merge 1 commit into
seal-2035-mw-m3b-close-cancelfrom
seal-2035-mw-m4-smoke-gate
Open

feat(compass-app): multi-window gtk3 e2e smoke gate (SEA-2035 M4)#369
rigel-mintaka wants to merge 1 commit into
seal-2035-mw-m3b-close-cancelfrom
seal-2035-mw-m4-smoke-gate

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 2 PRs:

  1. main
  2. feat(compass-app): close-time cancel of a window's in-flight calls (SEA-2035 M3b) #360
  3. "feat(compass-app): multi-window gtk3 e2e smoke gate (SEA-2035 M4)" (this PR)

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 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

@linear-code

linear-code Bot commented Aug 16, 2026

Copy link
Copy Markdown

SEA-2035

@rigel-mintaka
rigel-mintaka force-pushed the seal-2035-mw-m4-smoke-gate branch 3 times, most recently from 295eb7e to a72e6e2 Compare August 17, 2026 18:34
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
rigel-mintaka force-pushed the seal-2035-mw-m4-smoke-gate branch from a72e6e2 to d6db053 Compare August 17, 2026 18:47
@rigel-mintaka
rigel-mintaka force-pushed the seal-2035-mw-m3b-close-cancel branch from e183165 to 224e9b2 Compare August 17, 2026 18:48
@github-actions

Copy link
Copy Markdown

Compass engineering docs preview: https://seal-2035-mw-m4-smoke-gate.compass-eng-docs.pages.dev

Deployed from seal-2035-mw-m4-smoke-gate at d6db053.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant