orchestrator: SMOKE_VISIBLE=1 shows smoke runs on the user's screen (D-009)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
6ee1409c9a
commit
97205d2fb1
3 changed files with 33 additions and 15 deletions
|
|
@ -65,7 +65,7 @@ Never modify: `~/Documents/Apps/Nacre` (the original Python Nacre, reference onl
|
|||
| `nice cargo build --release -j 2` | compile check, produces `target/release/nacre` | now |
|
||||
| `nice cargo test --release -j 2` | unit tests (38, ~16 s test-profile build then <1 s run; shares the S001 build) (util, settings, history, bookmarks, permissions, vault, dns, bridge loopback, download, adblock, keys, scripts, updates, inject, hub, theme, ui::widgets input, ui::paint) | first successful build; not alongside a build |
|
||||
| `src/selftest.rs` | in-app self test: `NACRE_SCRIPT=<file>` runs script commands (listed at its top) | now |
|
||||
| `tools/smoke.sh <script> [outdir]` | smoke run on a hidden Xvfb display with a throwaway home and software GL; outdir (default `target/smoke/<name>-<time>`) gets `nacre.log`, `selftest.log`, `<shot>.png`, `<status>.json`, `home/`; exits non-zero on crash, panic or no `status done`. Scripts in `tests/smoke/` (`launch.txt` offline, `https.txt` needs internet, `restore.txt` with `SMOKE_HOME=<launch outdir>/home`, `chrome.txt` chrome and every flyout dark and light, offline); header documents env vars and commands. Read the PNGs | now (S003) |
|
||||
| `tools/smoke.sh <script> [outdir]` | smoke run on a hidden Xvfb display with a throwaway home and software GL; outdir (default `target/smoke/<name>-<time>`) gets `nacre.log`, `selftest.log`, `<shot>.png`, `<status>.json`, `home/`; exits non-zero on crash, panic or no `status done`. Scripts in `tests/smoke/` (`launch.txt` offline, `https.txt` needs internet, `restore.txt` with `SMOKE_HOME=<launch outdir>/home`, `chrome.txt` chrome and every flyout dark and light, offline); header documents env vars and commands. `SMOKE_VISIBLE=1` shows the run on the user's screen (DP-1, real GPU, niri tiles the window so shots are narrower); use it whenever the user is watching (D-009). Read the PNGs | now (S003) |
|
||||
| `nacre://gallery` + `SMOKE_SIZE=1400x2800 tools/smoke.sh tests/smoke/gallery.txt` | every design token and widget, dark and light (+ new tab and settings shots); read the PNGs | now (S015) |
|
||||
| `python tools/icons.py` | rebuilds the icon font subset and `src/ui/icons.rs` from `tools/icons.txt` (needs fontTools and Arch's ttf-material-symbols-variable) | now (S015) |
|
||||
| appimagetool, wine + Inno Setup, VM "Windows 10" | packaging and Windows checks | see the user's global CLAUDE.md "Building" |
|
||||
|
|
|
|||
|
|
@ -11,3 +11,4 @@
|
|||
- D-007 — 2026-11-11 — Run order changed: after S005 the UI redesign (S015–S021) runs next, then the rest of Verify and Gaps (S006–S014). S015's dependency on S014 is replaced by S005. Phase 1 review items R1-01 (icons), R1-02 (clock), R1-05 and R1-06 (old-Nacre feel, animations, "unslop" look) are redesign input; R1-03 (YouTube) and R1-04 (captchas, caching) go to S006/S007. — The user chose it after the phase 1 review. — S006–S021
|
||||
- D-008 — 2026-11-11 — One painter per window, shared by all its tabs (not one per tab). Picture-in-picture reloads the page in a dedicated web view and seeks the video (page state is lost). — Per-tab painters cost ~56 MB + 6 threads each (15 tabs: 1128 MB vs 341 MB) with equal frame time; the 4 GB target PC. The user chose it (option B in S005). — S005, any plan touching painters or PiP
|
||||
- D-009 — 2026-11-11 — Material You colours come from the `material-colors` crate pinned at `=0.4.2` (MCU port: HCT, tonal palettes, all scheme variants), not an own port. Icons are Material Symbols Outlined, cut to the names in `tools/icons.txt` by `tools/icons.py` (55 KB, FILL and wght axes kept). — 0.5.0 needs Rust 1.97 and the project allows 1.88; the crate matches MCU's reference colours (theme tests). The user's old Nacre used Material Symbols too. — S015–S020: add an icon by editing tools/icons.txt and running the tool
|
||||
- D-009 — 2026-11-11 — Smoke runs open visibly on the user's screen (`SMOKE_VISIBLE=1 tools/smoke.sh …`, niri monitor DP-1, real GPU) while the user wants to watch; hidden Xvfb (D-005) stays the default and the fallback when no Wayland session is there. Visible runs still use a throwaway home/runtime dir and share only the Wayland socket. — The user asked to see what the sessions test. Bonus: real-GPU coverage. Shots are narrower (niri tiling), so don't compare pixel sizes with Xvfb shots. — every plan that runs smoke scripts
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
# SMOKE_SIZE=WxH screen size (default 1280x800)
|
||||
# SMOKE_BIN=path browser binary (default target/release/nacre)
|
||||
# NACRE_NO_BRIDGE=1 passed through: no network bridge
|
||||
# SMOKE_VISIBLE=1 show the window on the user's screen (their Wayland display, niri monitor
|
||||
# SMOKE_MONITOR, default DP-1) with the real GPU instead of hidden Xvfb + software GL;
|
||||
# only the Wayland socket is shared, profile/runtime dir/bus stay throwaway
|
||||
#
|
||||
# Script commands (src/selftest.rs has the full list): wait <s>, waitload [s], open <url>, newtab <url>,
|
||||
# page <nacre://...>, shot <name>, status <name>, set <json pointer> <json>, flyout <name>, do <action>,
|
||||
|
|
@ -31,7 +34,13 @@ script=${1:?usage: tools/smoke.sh <script.txt> [outdir]}
|
|||
out=${2:-$root/target/smoke/$(basename "$script" .txt)-$(date +%Y%m%d-%H%M%S)}
|
||||
bin=${SMOKE_BIN:-$root/target/release/nacre}
|
||||
[ -x "$bin" ] || { echo "smoke: no binary at $bin (build first)" >&2; exit 2; }
|
||||
command -v Xvfb >/dev/null || { echo "smoke: Xvfb is missing (pacman -S xorg-server-xvfb)" >&2; exit 2; }
|
||||
visible=${SMOKE_VISIBLE:-}
|
||||
if [ -n "$visible" ]; then
|
||||
[ -n "${WAYLAND_DISPLAY:-}" ] && [ -S "${XDG_RUNTIME_DIR:-}/$WAYLAND_DISPLAY" ] \
|
||||
|| { echo "smoke: SMOKE_VISIBLE needs the user's Wayland session" >&2; exit 2; }
|
||||
else
|
||||
command -v Xvfb >/dev/null || { echo "smoke: Xvfb is missing (pacman -S xorg-server-xvfb)" >&2; exit 2; }
|
||||
fi
|
||||
|
||||
mkdir -p "$out"
|
||||
out=$(cd "$out" && pwd)
|
||||
|
|
@ -50,23 +59,31 @@ cleanup() {
|
|||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# Xvfb picks a free display number and writes it to fd 3.
|
||||
exec 3<>"$runtime/display"
|
||||
Xvfb -displayfd 3 -screen 0 "${SMOKE_SIZE:-1280x800}x24" -nolisten tcp -noreset >"$out/xvfb.log" 2>&1 &
|
||||
xvfb_pid=$!
|
||||
for _ in $(seq 50); do
|
||||
display=$(head -n1 "$runtime/display" 2>/dev/null)
|
||||
[ -n "$display" ] && break
|
||||
sleep 0.1
|
||||
done
|
||||
[ -n "${display:-}" ] || { echo "smoke: Xvfb did not start (see $out/xvfb.log)" >&2; exit 1; }
|
||||
if [ -n "$visible" ]; then
|
||||
# Share only the compositor socket; open the window on the chosen monitor.
|
||||
ln -s "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" "$runtime/wayland-0"
|
||||
command -v niri >/dev/null && niri msg action focus-monitor "${SMOKE_MONITOR:-DP-1}" >/dev/null 2>&1
|
||||
dispvars=(WAYLAND_DISPLAY=wayland-0 XDG_SESSION_TYPE=wayland)
|
||||
else
|
||||
# Xvfb picks a free display number and writes it to fd 3.
|
||||
exec 3<>"$runtime/display"
|
||||
Xvfb -displayfd 3 -screen 0 "${SMOKE_SIZE:-1280x800}x24" -nolisten tcp -noreset >"$out/xvfb.log" 2>&1 &
|
||||
xvfb_pid=$!
|
||||
for _ in $(seq 50); do
|
||||
display=$(head -n1 "$runtime/display" 2>/dev/null)
|
||||
[ -n "$display" ] && break
|
||||
sleep 0.1
|
||||
done
|
||||
[ -n "${display:-}" ] || { echo "smoke: Xvfb did not start (see $out/xvfb.log)" >&2; exit 1; }
|
||||
dispvars=(DISPLAY=":$display" XDG_SESSION_TYPE=x11 LIBGL_ALWAYS_SOFTWARE=1)
|
||||
fi
|
||||
|
||||
env -u WAYLAND_DISPLAY -u DBUS_SESSION_BUS_ADDRESS -u NACRE_HOME \
|
||||
env -u WAYLAND_DISPLAY -u DISPLAY -u DBUS_SESSION_BUS_ADDRESS -u NACRE_HOME \
|
||||
-u http_proxy -u https_proxy -u all_proxy -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY \
|
||||
DISPLAY=":$display" XDG_SESSION_TYPE=x11 \
|
||||
"${dispvars[@]}" \
|
||||
HOME="$home" XDG_CONFIG_HOME="$home/.config" XDG_DATA_HOME="$home/.local/share" \
|
||||
XDG_CACHE_HOME="$home/.cache" XDG_RUNTIME_DIR="$runtime" \
|
||||
LIBGL_ALWAYS_SOFTWARE=1 RUST_BACKTRACE=1 NACRE_SCRIPT="$out/script.txt" \
|
||||
RUST_BACKTRACE=1 NACRE_SCRIPT="$out/script.txt" \
|
||||
timeout -k 10 "${SMOKE_TIMEOUT:-180}" "$bin" >"$out/nacre.log" 2>&1
|
||||
code=$?
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue