ui-smoke phase 3: screenshots, writable config mirrors, homing settle#4136
ui-smoke phase 3: screenshots, writable config mirrors, homing settle#4136grandixximo wants to merge 4 commits into
Conversation
|
For now the screenshots of the UI are uploaded, and it is up to the reviewers to check, if wanted we could save in source a screenshot to verify against that nothing changed, but then it will be a bit of a bother when anything is supposed to actually change, and for UI with multiple pages, we may want to verify with more than one screenshot at probably more than one resolution? that could take a while, or we can just call it done here, verify UI works with uploaded screenshot is already pretty good, |
…pass Capture a PNG of the GUI before teardown and upload it as a CI artifact. On a failure the picture shows the cause (a GUI hung on a blocking modal leaves no core for crashdump.sh and no Python traceback, only a 60s timeout). On a clean Phase 2 run it is a confirmation shot (confirm.png) of the GUI in its post-movement idle state, so a reviewer can eyeball the final DRO / toolpath. Phase 1 passes stay silent (no program ran). _lib/screenshot.sh handles two capture paths: - GTK GUIs (axis, touchy, gmoccapy) render to the X server, grabbed with ImageMagick import (falling back to xwd|convert locally). There is no window manager under xvfb-run, so a GUI's maximize() is a no-op and it renders at its natural size; the Xvfb screen is sized 1920x1080 in launch-env.sh so the whole window is captured instead of clipped. - qtdragon runs the offscreen Qt platform (xcb segfaults qtvcp on Ubuntu 24.04), which never draws to X, so an X grab is black. Instead the qtdragon shim installs a SIGUSR1 handler that grabs its top-level window to UI_SMOKE_QT_SHOT; the launcher signals it and collects the file. The grab is a no-op with a logged reason when there is no display, no grabber, or no GUI to signal, so it can never turn a pass into a fail. screenshot.png, confirm.png and ui-smoke-qt.png are gitignored; imagemagick is declared under !nocheck; ci.yml uploads ui-smoke-screenshots-* on every run.
gmoccapy writes its preference file next to the config (config dir + <MACHINE>.pref, no PREFERENCE_FILE_PATH in gmoccapy.ini). The workspace is read-only for the runtime user on CI, so that write raises PermissionError partway through __init__, before the MDIHistory widget's _hal_init runs. gmoccapy pops an error dialog and limps on half built: the interp-idle handler then hits a widget with no .stat and throws a second dialog. The smoke test still passed (NML drove behind the dialogs), so the breakage was invisible until the Phase 3 confirm shot showed it. Mirror the config to a writable tmp dir (the fix qtdragon already uses) so the pref write succeeds. With the config writable the first-run "Important change(s)" modal then appears; it runs a nested gtk loop that never gets dismissed headless, sitting over the UI and swallowing the SIGTERM in the quit test. Seed hide_startup_messsage in the mirrored pref to suppress it, the same as a user ticking "Don't show this again". gmoccapy smoke and gmoccapy-quit now come up clean.
The driver requested AUTO the instant homing completed per NML stat, but gmoccapy only enables AUTO once it has processed the all-homed signal in its own event loop (and re-asserts MANUAL itself on that signal). The early request was rejected, bounced back to MANUAL with an "It is not possible to change to Auto Mode" warning that lingered in the confirm shot; ensure_mode retried and won, so the run still passed. A short settle after homing lets the GUI catch up, so AUTO is accepted first try.
On a clean run-program run we already grab confirm.png of the GUI in its post-movement idle state. This adds a committed per-GUI known-good reference.png and, on each run, an ImageMagick comparison that writes a highlighted diff.png and logs the differing-pixel count. The comparison NEVER fails a test: freetype/font versions differ across distros, so some drift is expected (the same machine already shows a few hundred AE pixels in the 3D toolpath preview). The diff is only recorded, not used to gate the test. compare.sh is sourced like screenshot.sh (logged no-op when it cannot run). make-references.sh regenerates the references locally via UI_SMOKE_UPDATE_REFERENCE=1. confirm.png/diff.png are gitignored and uploaded as CI artifacts; reference.png is committed. References for axis, gmoccapy, touchy and qtdragon were captured on Debian trixie.
fb9f031 to
186c3a3
Compare
|
Added the known-good image comparison. On a clean run each GUI's confirm.png is compared (ImageMagick) against a committed reference.png, and both the shot and a highlighted diff.png are uploaded as CI artifacts. It never fails a test: font/freetype versions differ across distros, so we just record the diff to gather experience first. Even same-machine the 3D preview drifts a few hundred pixels, a handy sanity check. Regenerate locally on a built RIP tree with tests/ui-smoke/_lib/make-references.sh (sets UI_SMOKE_UPDATE_REFERENCE=1). The four baselines were captured on Debian trixie; other distros will differ, which is what we want to observe. Also rebased onto master. @BsAtHome This should fit the shape we discussed in the meeting and by email. |
Builds on the merged phase 2 (#4054). This phase makes the ui-smoke runs more diagnosable and adds writable-config handling so the GUIs start cleanly headless.
What's here:
hide_startup_messsageso the "Important change(s)" modal stays hidden (the same effect as ticking "Don't show this again"). This is the headless-start fix discussed in gmoccapy: modal startup "Important change(s)" dialog blocks headless / non-interactive startup #4072.Scope note: the touchy window-fit smoke test is intentionally held back on a separate branch, since it depends on the touchy fitting changes in #4131 which are not merged yet. I will send it as a follow-up once #4131 lands.