ui-smoke phase 3: screenshots, writable config mirrors, homing settle#4136
Open
grandixximo wants to merge 3 commits into
Open
ui-smoke phase 3: screenshots, writable config mirrors, homing settle#4136grandixximo wants to merge 3 commits into
grandixximo wants to merge 3 commits into
Conversation
…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.
Contributor
Author
|
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, |
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.
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.