makepad/apps/calculator/ci.splash
Admin 229cdd4d2e ci: tools/ci, a Splash runtime that watches a branch and runs every ci.splash it finds -- each script checks its app on every other platform, builds and runs it here, drives it over --remote and has a small local vision model judge the grabs
A test is a ci.splash beside what it tests; the script decides every input and the model only ever judges one picture against one acceptance text. mod.ci: launch (hidden, --remote, user_seq preserved), key, type_text, click, get, snap, wait_log (a * is a gap inside one line), no_errors, grab, quit; step, sleep, check, run; cargo, check_targets (the cargo makepad check matrix, check only for platforms we are not on, a test fails if the two tables drift), test, build, machine (another box over the makepad tunnel), exclusive; judge, accept, ask. The watcher polls git ls-remote once a minute for work and any extra branches, syncs a checkout the CI owns, runs the root script first and alone, then the rest up to a parallel limit behind one shared model judge. The window is a wall of squares, one per script: green passed, orange warnings, red failures, with a detail panel for the selected one.

Scripts: the root ci.splash (workspace check with core warnings denied, the tests), apps/wm (desktop up, switch to macOS by Cmd+Space / type / Return, launch the terminal and the browser, each waited for by the WM's own first-frame line), and one per main app in the default shape. Proven here: apps/wm/ci.splash green in 280 s, fifteen target checks and seven vision verdicts.

Models come from Hugging Face through the hub: registry entries qwen3.5-4b-vision and qwen3.5-9b-vision with exact revisions, sizes and digests, and hub-install, a command line over LocalModels::start_install. vlm-probe reads PNG.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 21:23:11 +02:00

24 lines
1.7 KiB
Text

// CI smoke test for apps/calculator. Run by tools/ci, which finds every `ci.splash`
// in the checkout. The script decides every input; the vision model only
// judges the grab against the acceptance text below. Basic on purpose: does
// it check everywhere, build and come up here, and look like what it is.
use mod.std.*
use mod.ci;
ci.step("check other platforms", fn(){
ci.check_targets({packages: ["makepad-calculator"] targets: ci.host.targets})
})
let app = ci.launch({package: "makepad-calculator" binary: "calculator" cwd: "."})
ci.step("comes up", fn(){
ci.sleep(3.0)
app.no_errors()
let shot = app.grab("start")
ci.accept(shot, "This is a screenshot of one application window taken from a Mac. A thin bright red frame runs around the very edge of the picture; it is the test harness's marker and is not part of the application. Ignore it. The application is a calculator. It came up when these are true: 1. The picture is not blank: it is not one flat colour from edge to edge, and it is not entirely black or entirely white. 2. Some user interface is visible: at least two different things among text labels, buttons, icons, panels, lists, input fields, a toolbar, a drawing or a picture. 3. No error panel covers the window: there is no large block of text with words such as panic, error, failed, backtrace or unwrap. 4. A calculator keypad is visible: a grid of round or square buttons carrying digits and operators such as + and =, with a number display above it. Write one short bullet line for each numbered point saying what you see. YES means points 1, 2, 3 and 4 are all satisfied. Then write the verdict as the last line, in exactly this form: VERDICT: YES or VERDICT: NO")
})
app.no_errors()
app.quit()
nil