test: cover #148 (android)#186
Open
latekvo wants to merge 5 commits intofeat/android-emulator-supportfrom
Open
test: cover #148 (android)#186latekvo wants to merge 5 commits intofeat/android-emulator-supportfrom
latekvo wants to merge 5 commits intofeat/android-emulator-supportfrom
Conversation
3c89bef to
9bc0eef
Compare
Coverage moved out of feat/android-emulator-support so that branch's PR can be reviewed without the test churn. This stacked PR adds: - 19 new test files covering the Android dispatch path (adb hardening, describe-screen, injection hardening, simulator-server blueprint, uiautomator parser, ax-service / ios-only blueprint gating, list-devices, boot-device hot/cold boot + spawn-error + general, http dep gate, check-deps, describe missing xcrun, native-profiler missing trace, etc.) - Touch-ups to skills/update/auto-screenshot/native-devtools-status unit tests where main's existing assertions stayed compatible.
…r and ensureDep
Cover `resolveAndroidBinary` across the lookup chain — PATH preference,
$ANDROID_HOME-only, $ANDROID_SDK_ROOT-only, both unset, non-executable
file at the canonical SDK path — plus `ensureDep("emulator")` end-to-end
to confirm an SDK-installed-but-off-PATH emulator binary now passes the
dep check and a missing one surfaces a `DependencyMissingError` whose
hint mentions $ANDROID_HOME, not just PATH.
Each test sandboxes its env vars via beforeEach/afterEach so a vitest
worker can't leak ANDROID_HOME state into surrounding suites.
Two upstream changes broke a chunk of the Android test surface:
1. `runAdb` / `listAvds` / `boot-device` now route adb / emulator
invocations through `resolveAndroidBinary` (PATH → \$ANDROID_HOME →
\$ANDROID_SDK_ROOT), so existing test mocks that match `cmd === "adb"`
never fired on real hosts — the resolver returned an absolute path.
2. The uiautomator parser's v2 trim flattens layout-only wrappers,
drops decorative ImageViews, and surfaces interactivity as flags on
`DescribeNode` rather than as role promotion. Tests asserting the
pre-trim tree shape no longer matched.
For (1): stub `resolveAndroidBinary` per-file so the bare-name matchers
keep firing — `vi.mock("../src/utils/android-binary", ...)` next to the
existing `vi.mock("node:child_process", ...)`. The check-deps and
http-dep-gate suites also need a controllable mock so each test can
declare per-dep availability without fighting the host's real
\$ANDROID_HOME.
For (2): rewrite `android-describe-screen.test.ts` traversals against
the flattened tree (FrameLayout passthrough → 3 widgets at
`tree.children[0..2]` instead of nested under `children[0].children`).
Add interactivity-flag assertions for the new contract. The "zero
screen size" defensive test now expects an empty tree (the v2 trim's
visibility check drops nodes that fail the screen-area check, which is
a stronger and more useful invariant than the prior zero-frame leak).
Drop the `convertUiAutomatorNode`-direct test from
`uiautomator-parser-hardening.test.ts` — that helper no longer exists;
its 10k-deep stack-safety check is preserved via the
`parseUiAutomatorDump` and `parseUiAutomatorXml` calls in the same
suite.
622/622 tests green on the test branch after this update.
…croll-clip, SVG, system chrome Inline-XML coverage for every trim rule landed in the v2 parser refactor (commit 0128919, ported from #190): - duplicate-wrapper collapse (clickable parent + clickable child with identical bounds → keep inner) - password redaction (label="[password]", value never set, password flag true) - WebView opacity (DOM-side accessibility scaffold under the WebView must not bleed through as siblings) - compound-clickable label aggregation ("Alice / @alice" for a row whose own content-desc is empty) - EditText label/value separation (content-desc → label, text → value) - scroll-clip filtering with `scrollHidden` count (descendant outside ancestor scroll's viewport gets dropped, parent records the count) - com.android.systemui drop by default + `includeSystem` opt-in - React Native SVG sub-paths (com.horcrux.svg.{Path,Group,Svg}View) stripped wholesale - off-screen rect drop The fixture-based "Bluesky thread" sanity suite from #190 isn't ported because the dump it depends on (`research/android-ui-inspection/ artifacts/02_uiautomator_compressed.xml`) doesn't ship in this repo. The inline cases above cover every trim rule that suite exercises without needing an external artifact. Co-authored-by: Paweł Fornagiel <pawel.fornagiel2@gmail.com>
- uiautomator-parser-hardening.test.ts: rename two `describe()` titles and one inline comment off the removed internal `convertUiAutomatorNode` symbol; the public API under test is `parseUiAutomatorDump`. - uiautomator-parser-v2-trim.test.ts: drop the comment block that named a research artifact path that doesn't ship in this repo, plus the source-PR / commit-hash breadcrumb. - boot-device.test.ts: drop the `(previously boot-simulator)` historical breadcrumb from the iOS-path describe title.
9bc0eef to
8aad6c9
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.
This PR adds tests for #148.
Summary
Moves the Android emulator branch's test coverage out of #148 so that PR can be reviewed without the test churn. This branch adds the test files back on top of the (now test-stripped) base branch.
Tests inseparable from source changes (
describe-tool,workspace-reader,workspace-reader-integration) and theboot-simulator.test.tsdeletion stayed on #148 - base PR's CI passes on its own.Test plan
npx tsc --build— cleannpx prettier --check .— cleannpm test --workspaces --if-present— 585/585 tool-server tests pass; all other workspaces green