Files
feresaria/scripts/ci/run-native-checks.py
T
Samuel Onoja e22f0ebef9 Add panel-wide styles and the Morph hub (#26)
Panel appearance now applies to the whole panel, with seven styles: Floating, Capsules, Notch, Edge to edge, Fused islands, Adaptive and Morph.

- Share composition, geometry, and motion through the renderer-independent `ferese-panel` crate, including native materials, input regions, and Settings previews.
- Add the Morph hub with media, calendar, notifications, controls, workspace previews, hover feedback, and attached mode. Keep recording and low-battery status visible and respect window clearance.
- Cache workspace preview geometry, draw thumbnails directly, centralize Morph transitions, and keep rendering settings local to each shell instance.
- Put Record Screen in the Morph header and show the display control only when an external monitor is connected. Update panel documentation, the desktop screenshot, and native check style names.

Local validation included 660 compositor tests, 191 shell tests, isolated preview-cache checks, GPU Morph captures at 1×/1.25×/1.5×, formatting, and Clippy with warnings denied. The final header change passed all 23 Morph tests. Release workflow jobs are skipped for this PR.
2026-10-12 01:31:34 +01:00

92 lines
4.3 KiB
Python

"""Run native regressions on a private software-rendered Weston host."""
import argparse
import os
from pathlib import Path
import signal
import subprocess
import sys
import tempfile
import time
def stop(process):
if process.poll() is None:
os.killpg(process.pid, signal.SIGINT)
try:
process.wait(timeout=5)
except subprocess.TimeoutExpired:
os.killpg(process.pid, signal.SIGKILL)
process.wait(timeout=5)
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--log-dir", type=Path, required=True)
parser.add_argument("--suite", choices=("panel-xwayland", "desktop"), default="panel-xwayland")
args = parser.parse_args()
logs = args.log_dir.resolve()
logs.mkdir(parents=True, exist_ok=True)
repo = Path(__file__).resolve().parents[2]
env = {key: value for key, value in os.environ.items()
if not key.startswith("FERESE_") or key.startswith("FERESE_TEST_")}
for key in ("DISPLAY", "WAYLAND_DISPLAY", "WAYLAND_SOCKET", "XAUTHORITY",
"DBUS_SESSION_BUS_ADDRESS", "DBUS_SESSION_BUS_PID", "EGL_PLATFORM"):
env.pop(key, None)
env.update(LIBGL_ALWAYS_SOFTWARE="1", FERESE_TEST_LOG_DIR=str(logs))
for key, value in {"FERESE_TEST_BINARY": "target/debug/ferese",
"FERESE_TEST_CTL": "target/debug/feresectl",
"FERESE_TEST_SHELL": "target/debug/ferese-shell"}.items():
env.setdefault(key, value)
with tempfile.TemporaryDirectory(prefix="ferese-native-host-") as temporary:
root = Path(temporary)
runtime = root / "runtime"
runtime.mkdir(mode=0o700)
env.update(XDG_RUNTIME_DIR=str(runtime), WAYLAND_DISPLAY="ferese-test-host",
XDG_CONFIG_HOME=str(root / "config"), XDG_STATE_HOME=str(root / "state"),
XDG_CACHE_HOME=str(root / "cache"))
with (logs / "weston.log").open("w") as log:
host = subprocess.Popen([
env.get("FERESE_TEST_WESTON", "weston"),
"--backend=headless-backend.so", "--renderer=pixman",
"--width=1600", "--height=1000", "--socket=ferese-test-host",
"--idle-time=0", "--no-config",
], env=env, stdout=log, stderr=log, start_new_session=True)
try:
deadline = time.monotonic() + 15
while not (runtime / env["WAYLAND_DISPLAY"]).is_socket():
if host.poll() is not None or time.monotonic() >= deadline:
raise RuntimeError((logs / "weston.log").read_text())
time.sleep(.05)
cases = [
("shell-flat", "shell_motion", {"FERESE_TEST_SHELL_MOTION": "1", "FERESE_TEST_BAR_LAYOUT": "flat"}),
("shell-floating", "shell_motion", {"FERESE_TEST_SHELL_MOTION": "1", "FERESE_TEST_BAR_LAYOUT": "floating"}),
]
if args.suite == "desktop":
cases.insert(0, ("lock", "lock", {"FERESE_TEST_LOCK": "1", "FERESE_TEST_BIN_DIR": "target/debug"}))
cases.extend([
("presentation", "presentation", {"FERESE_TEST_PRESENTATION": "1"}),
("resize", "resize_dependencies", {"FERESE_TEST_RESIZE": "1"}),
])
else:
cases.append(("xwayland", "xwayland", {"FERESE_TEST_XWAYLAND": "1"}))
for name, script, options in cases:
print(f"Running {name}", flush=True)
with (logs / f"{name}-test.log").open("w") as output:
test = subprocess.Popen([
sys.executable, f"scripts/tests/test_{script}_isolated.py", "-v",
], cwd=repo, env=dict(env, **options), stdout=output, stderr=output,
start_new_session=True)
try:
status = test.wait(timeout=180)
if status:
raise RuntimeError((logs / f"{name}-test.log").read_text())
finally:
stop(test)
print(f"Passed {name}", flush=True)
finally:
stop(host)
if __name__ == "__main__":
main()