test: #699 — behavioral coverage for runtime UI FFI surface#759
Merged
Conversation
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.
3d2153c to
c28b0a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Text,Box,Spacer,ProgressBar,Spinner,AnimatedSpinner,Input,List,Select,TextArea,Table,Tabs), Box style setters (flexbox, padding variants, percentage units), reactivestate(), and the full hook surface (useState,useStateSet,useStateTuple,useRef,useMemo,useEffect,useApp,useStdout,useFocus,useFocusManager,useInput).@coversblocks to existing run-loop-driven tests (test_perry_tui_inkcompat_useapp.ts,test_perry_tui_inkcompat_usefocus.ts) plustest_issue_351_media_playback.tsandtest_issue_679_perry_tui_jsx_audit.tsxso the underlying FFIs (js_perry_tui_app_exit,js_perry_tui_run,js_perry_tui_focus_next,js_jsxs, theperry_media_*family, …) are attributed to those behavioral tests../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-landedjs_array_*/js_template_*/js_unresolved_default_callentries totest_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 bridgegeisterhand_registry.rs— HTTP-driven UI inspector registryios_game_loop.rs/watchos_game_loop.rsui_text_registry.rs— per-target setText / showToast / navstack route handlersRelated 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 (DONEline at the tail, all assertions log1/ 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 importperry/tui); compile-smoke job is the gatenode --experimental-strip-types test-files/test_issue_699_runtime_ui_surface.tsreturns exit 1, matching the parity runner's NODE_FAIL skip path used by every other TUI fixture in the treeNotes
The new fixture is
node --experimental-strip-types-incompatible (perry/tuihas no Node equivalent), so the parity runner skips it the same way it already skipstest_issue_358_perry_tui_*/test_perry_tui_inkcompat_*. The compile-smoke CI job verifies every call site lowers cleanly.Checklist