Skip to content

test(nsgo): run the client's suite in a real window and keep its pictures - #277

Merged
bketelsen merged 2 commits into
mainfrom
test/nsgo-live-suite
Nov 24, 2026
Merged

bketelsen merged 2 commits into
mainfrom
test/nsgo-live-suite

Conversation

@bketelsen

Copy link
Copy Markdown
Contributor

Summary

The NSGo client's suite also runs in a real window, and the repository keeps pictures of today's look, before any look changes. It is Frostnotes' part of Phase 0.5 of the plan for one look across the three NSGo apps (frostyard/frostmail, plan 0016); FrostMail's part is frostyard/frostmail#390. Until now the suite ran headless only, where NSGo models the views and draws no pixel.

  • A real window. TestMain starts NSGo's test host, so go tool nsgo test -target linux runs the same tests in a GTK 4 window. make nsgo-live does that under Xvfb. The Verify job runs it after make verify and uploads the pictures it drew as nsgo-live-pictures.
  • The pictures. 8 picture tours name a picture at each main view. cmd/frostnotes-nsgo/comparison/linux keeps 19 of today's look (852 KB): the empty state, a note as source and as live preview, 4 dialogs, quick open, vault search, the vault manager and the join form, the no-vault state, 3 narrow views and 2 in the dark appearance. make nsgo-pictures takes them again; 3 takes gave the same bytes. No test compares pixels.
  • Docs. docs/design/app.md has the section "The NSGo client's live suite"; AGENTS.md lists the gates.

What the real window showed

With only TestMain and a path fix, 3 of the 4 existing workflows failed in the window and passed headless. All 3 are differences of NSGo v0.3.0's test host, not of the app; no app code and no assertion changes.

  • The app's clock stands still during a wait on a target. The search's 250 ms debounce and the session's 1 s redial never fired. waitTimers advances the clock between checks, in both runs.
  • A line break typed into a multiline field is dropped on the Linux target. typeLines commits the text on a target and types it headless.
  • App.Paste skips the whole test on a target. TestSwitchNoteDuringAutosave leaves out the paste and its undo there (headlessStep) and runs every other step. It is the one step that stays headless-only.

Now 12 tests (4 workflows, 8 tours) pass headless and in the window, and none skips.

Two faults the pictures show, recorded in the design doc and not fixed here:

  • A narrow window in the dark appearance is close to unreadable (dark-narrow-note.png): the compact shell paints no ground, so light text sits on white. The fix belongs in the shared kit (frostui's workspaceui).
  • Cancel and the confirming button look the same in every dialog.

GTK on Xvfb

NSGO_LIVE sets GDK_BACKEND=x11. Unsetting WAYLAND_DISPLAY is not enough: GTK tries Wayland first and finds a desktop's compositor at the default socket. frostyard/frostmail#394 makes the same fix there.

Risk tier

Risk tier: 3 — the change matches L2 paths.

  • .github/workflows/** (ci.yml): the Verify job gains 3 steps after make verify: an apt-get install of the window runtime (the list frostmail's NSGo job installs, which passed on a runner there), make nsgo-live, and actions/upload-artifact at the SHA this repository already pins. The job's permissions do not change. It adds the live suite's time to Verify, which is not measured on a runner yet.
  • Makefile: 2 new targets, nsgo-live and nsgo-pictures. No existing target changes.

Docs housekeeping

  • Cross-links added in both directions (ADR ↔ design ↔ spec ↔ plan)
  • Conformance aliases and canonical symlinks are unchanged; canonical targets are edited instead

Verification

  • make check green (host, exit 0)
  • make nsgo-check green (host), the js/wasm build included
  • make nsgo-live green (host, Xvfb's X11), run by two sessions: 12 passed, 0 failed, 0 skipped
  • Workflows changed: every action is SHA-pinned with # vX.Y.Z, permissions: {}, and persist-credentials: false
  • Not checked: the new CI steps on a runner (this run is the check), make ci, and the pictures on any host but this one.

It touches ci.yml and the Makefile, as #276 does; a trial merge of the two was clean.

…ures

Frostnotes' part of Phase 0.5 of frostmail's plan 0016. The NSGo client's
suite ran headless only, where NSGo models the views and draws no pixel.

- TestMain starts NSGo's test host, so `go tool nsgo test -target linux`
  runs the same tests in a GTK 4 window. `make nsgo-live` does that under
  Xvfb; CI's Verify job runs it after `make verify` and uploads its
  pictures.
- 8 picture tours name a picture at each main view on a hand-written
  vault. cmd/frostnotes-nsgo/comparison/linux keeps 19 of today's look,
  the "before" set; `make nsgo-pictures` takes them again. The tours pin
  light or dark, and a GTK settings file stops the caret's blinking: 3
  takes on 1 host gave the same bytes.
- The tests find the repository from any working directory: on a target
  it is not the package's.
- GDK_BACKEND=x11 keeps the windows on Xvfb. With only WAYLAND_DISPLAY
  unset, GTK still opened the desktop's compositor at wayland-0.

Unchanged, 3 of the 4 workflows passed headless and failed in the window.
All 12 tests now pass in both, and none skips:

- A wait does not move the app's clock on a target, so vault search's
  debounce and the session's dial after a dropped connection never came
  due. waitTimers moves the clock while it waits.
- NSGo's Linux test host drops a line break typed in a text view.
  typeLines enters the text as an input method's commit there.
- App.Paste skips a test on a target. TestSwitchNoteDuringAutosave leaves
  out its paste and the undo after it there, and runs its other steps.
@github-actions github-actions Bot added level:L2 Read the diff risk:high Touches a path in .github/risk-paths.json labels Nov 24, 2026
@bketelsen
bketelsen merged commit 6fd7634 into main Nov 24, 2026
15 checks passed
@bketelsen
bketelsen deleted the test/nsgo-live-suite branch November 24, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L2 Read the diff risk:high Touches a path in .github/risk-paths.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant