Skip to content

test: #699 — behavioral coverage for runtime UI FFI surface#759

Merged
proggeramlug merged 1 commit into
mainfrom
test/issue-699-runtime-ui-behavioral-coverage
May 14, 2026
Merged

test: #699 — behavioral coverage for runtime UI FFI surface#759
proggeramlug merged 1 commit into
mainfrom
test/issue-699-runtime-ui-behavioral-coverage

Conversation

@TheHypnoo
Copy link
Copy Markdown
Contributor

Summary

  • Adds test_issue_699_runtime_ui_surface.ts, a host-independent fixture that exercises the testable runtime UI FFI surface: TUI widget constructors (Text, Box, Spacer, ProgressBar, Spinner, AnimatedSpinner, Input, List, Select, TextArea, Table, Tabs), Box style setters (flexbox, padding variants, percentage units), reactive state(), and the full hook surface (useState, useStateSet, useStateTuple, useRef, useMemo, useEffect, useApp, useStdout, useFocus, useFocusManager, useInput).
  • Attaches @covers blocks to existing run-loop-driven tests (test_perry_tui_inkcompat_useapp.ts, test_perry_tui_inkcompat_usefocus.ts) plus test_issue_351_media_playback.ts and test_issue_679_perry_tui_jsx_audit.tsx so the underlying FFIs (js_perry_tui_app_exit, js_perry_tui_run, js_perry_tui_focus_next, js_jsxs, the perry_media_* family, …) are attributed to those behavioral tests.
  • Re-runs ./test-coverage/regen_ts_surface_inventory.py. The runtime-UI inventory drops from 121 → 44 unique FFI names (a regen-script side effect also adds 17 newly-landed js_array_* / js_template_* / js_unresolved_default_call entries to test_ffi_surface_runtime_core.ts).

The 44 remaining entries are exactly the platform-only callback shims that have no host TS surface and need target-gated simulator coverage as separate follow-ups:

  • arkts_callbacks.rs — HarmonyOS ArkTS bridge
  • geisterhand_registry.rs — HTTP-driven UI inspector registry
  • ios_game_loop.rs / watchos_game_loop.rs
  • ui_text_registry.rs — per-target setText / showToast / navstack route handlers

Related issue

Test plan

  • ./test-coverage/regen_ts_surface_inventory.py — runtime-UI inventory shrunk from 121 → 44 entries
  • ./test-coverage/audit.sh --markdown — still reports 100% TypeScript FFI surface coverage (1790/1790)
  • ./target/release/perry test-files/test_issue_699_runtime_ui_surface.ts -o /tmp/out && /tmp/out — compiles and runs deterministically end-to-end (DONE line at the tail, all assertions log 1 / expected values)
  • ./run_parity_tests.sh --filter test_ffi_surface — all 5 inventory fixtures pass parity (100%)
  • ./run_parity_tests.sh --filter test_issue_699 — skipped as expected (Node can't import perry/tui); compile-smoke job is the gate
  • node --experimental-strip-types test-files/test_issue_699_runtime_ui_surface.ts returns exit 1, matching the parity runner's NODE_FAIL skip path used by every other TUI fixture in the tree

Notes

The new fixture is node --experimental-strip-types-incompatible (perry/tui has no Node equivalent), so the parity runner skips it the same way it already skips test_issue_358_perry_tui_* / test_perry_tui_inkcompat_*. The compile-smoke CI job verifies every call site lowers cleanly.

Checklist

  • I have NOT bumped the workspace version or edited CLAUDE.md / CHANGELOG.md
  • My commit follows the loose conventional prefix style used in the log
  • I've read CONTRIBUTING.md and agree to the Code of Conduct

Adds test_issue_699_runtime_ui_surface.ts, a host-independent fixture
that exercises the testable runtime UI FFI surface — TUI widget
constructors, Box style setters, Phase 4 widgets, reactive state, and
hooks (useState/useEffect/useApp/useStdout/useFocus/useFocusManager).
Attaches @Covers blocks to existing run-loop tests (useApp, useFocus)
plus media playback and JSX audit so the runtime-UI inventory drops
from 121 → 44 entries via test-coverage/regen_ts_surface_inventory.py.

The 44 remaining entries are the platform-only callback shims
(arkts_callbacks, geisterhand_registry, ios/watchos game loop,
ui_text_registry) that have no host TS surface and need target-gated
simulator coverage as separate follow-ups.

test-coverage/audit.sh still reports 100% TypeScript FFI surface
coverage.
@proggeramlug proggeramlug force-pushed the test/issue-699-runtime-ui-behavioral-coverage branch from 3d2153c to c28b0a6 Compare May 14, 2026 05:32
@proggeramlug proggeramlug merged commit 1a7ce21 into main May 14, 2026
9 checks passed
@proggeramlug proggeramlug deleted the test/issue-699-runtime-ui-behavioral-coverage branch May 14, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants