Skip to content

Develop and test

Choose unit, mock integration, compositor, and performance checks.

Akari separates fast repository verification from live compositor, multi-monitor, and hardware login tests.

Repository verification

Run static analysis, Rust checks, and unit/widget test suites across shared packages and themes:

# Check the entire repository and all built-in themes
fvm dart run packages/akari_cli/bin/akari.dart verify

# Scope theme checks to a single theme while keeping shared + backend checks
fvm dart run packages/akari_cli/bin/akari.dart verify --theme themes/fallback

What to focus on when writing tests:

  • Test behavior and invariants: Scene validation, state transitions, attempt isolation, slot notifications, focus/keyboard traversal, resource disposal, and frame budgets.
  • Avoid brittle layout assertions: Do not assert hardcoded pixel coordinates; check reachability, minimum hit target sizes, focus order, and absence of overflow instead.

packages/akari_cli/test/login_cli_test.dart also invokes test/workflows/login_workflow_test.py to test deployment, rollback, and recovery in simulated systemd environments without touching your host display manager.

Mock D-Bus & UI walkthroughs

WorkflowCommandWhen to use
Automated UI walkthroughfvm dart run packages/akari_cli/bin/akari.dart preview --theme themes/fallbackRun face-success and password-fallback journeys in one window and exit
Interactive mock sessionfvm dart run packages/akari_cli/bin/akari.dart run --theme themes/fallbackExercise the full Flutter + D-Bus + Rust mock backend path with hot reload
Nested or headless Swayfvm dart run packages/akari_cli/bin/akari.dart run sway --display-profile referenceTest compositor scaling and fixed-resolution screenshots (guide)
Real TTY loginakari greetd-test ...Test actual PAM, DRM/KMS splash, and session launch (guide)

Native display regressions

Opt-in Python regression suites launch real Flutter windows inside isolated headless Sway compositors. They require sway, swaymsg, grim, and wtype.

Multi-monitor & hotplug regression

Build a demo bundle from apps/greeter/lib/main.dart (do not use preview binaries, which exit after their test journey) and run the workflow script:

fvm dart run packages/akari_cli/bin/akari.dart generate-scenes --theme themes/default
(cd apps/greeter && fvm flutter build linux --release --dart-define=AKARI_BACKEND=demo)
python3 test/workflows/multi_display_workflow_test.py \
  --app apps/greeter/build/linux/x64/release/bundle/greeter

This verifies mixed DPI scales, pointer focus switching across views, monitor hotplug (including removing all monitors and reconnecting), and single-window mode.

Nested scale matrix regression

  1. Build the default theme and mock backend by starting a headless Sway session once:

    fvm dart run packages/akari_cli/bin/akari.dart run sway --theme themes/default \
      --display-profile reference --sway-backend headless \
      --report build/tool/native-sway.json
  2. Press q after startup, read artifacts.executable and artifacts.backend_executable from build/tool/native-sway.json, and run:

    python3 test/workflows/sway_native_workflow_test.py \
      --app /path/to/greeter/bundle/greeter \
      --backend /path/to/mock/backend

This tests all four combinations of outer and inner scales (1.0 and 1.6) and verifies 1920x1080 inner screenshots.

Performance gates

Execute a theme’s declared performance gate or timeline trace:

fvm dart run packages/akari_cli/bin/akari.dart verify-perf --theme themes/default
fvm dart run packages/akari_cli/bin/akari.dart trace-perf --theme themes/default

Each theme declares its own runner and thresholds in pubspec.yaml (see the Performance protocol).

Diagnose failures

Every CLI run writes structured logs and reports under build/tool/runs/<run-id>/:

  • Pass --format json or --report PATH to inspect step metadata and artifact paths.
  • Check the failing step’s stderr log file first.