Launch the real Waybar binary inside a headless, software-rendered sway compositor and verify it actually runs and renders — something the unit tests and build jobs never do. - test/smoke/run.sh: boots sway (WLR_BACKENDS=headless, pixman), starts waybar, asserts it stays alive with no fatal log, optionally grabs a screenshot with grim - level 1: real modules (clock/cpu/memory/disk) load without crashing - level 2: deterministic config is screenshotted and checked to be non-blank - level 3: screenshot compared to test/smoke/reference.png (fuzz 8%, 800px tolerance); screenshot + diff uploaded as artifacts - .github/workflows/smoke.yml runs it on push/PR The reference image must be blessed from a CI artifact (see test/smoke/README.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1.3 KiB
1.3 KiB
Smoke / screenshot test
The smoke workflow launches the real
Waybar binary inside a headless sway compositor (software-rendered, no GPU)
and checks three things:
- It starts and stays alive — with real modules (
clock,cpu,memory,disk) loaded, Waybar must not crash or log a fatal error. (modules-config.jsonc) - It renders — a deterministic config (
config.jsonc+style.css) is captured withgrim; the bar strip must not be blank. - It looks right — the screenshot is compared to
reference.pngwith an 8% fuzz and an 800-pixel tolerance. Regressions fail the job, and the screenshot and diff are uploaded as artifacts.
Updating the reference image
reference.png must be generated by the CI environment (local rendering differs
from Ubuntu's). To (re)bless it:
- Push your change and open the run of the
smokeworkflow. - Download the
waybar-screenshotartifact. - Commit its
bar.pngastest/smoke/reference.png.
Do this whenever an intended visual change makes the golden comparison fail.
Run locally
On a machine with sway, grim and waybar:
./test/smoke/run.sh test/smoke/config.jsonc test/smoke/style.css /tmp/bar.png