Files
Waybar/test/smoke
Alex 0c059db0fd ci(smoke): add reference screenshot to enable golden comparison
Blessed from the CI artifact of the passing headless run (Waybar / CI smoke
test / 12:34 on a pinned DejaVu Sans bar). Regenerate from a new artifact when
an intended visual change trips the comparison — see test/smoke/README.md.
2026-07-04 13:28:48 +02:00
..

Smoke / screenshot test

The smoke workflow launches the real Waybar binary inside a headless sway compositor (software-rendered, no GPU) and checks three things:

  1. 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)
  2. It renders — a deterministic config (config.jsonc + style.css) is captured with grim; the bar strip must not be blank.
  3. It looks right — the screenshot is compared to reference.png with 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:

  1. Push your change and open the run of the smoke workflow.
  2. Download the waybar-screenshot artifact.
  3. Commit its bar.png as test/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