Skip to content

test(android,harmonyos,linux,provision-kit): cover boot-failure and toolchain probe branches - #3433

Merged
thymikee merged 2 commits into
mainfrom
crap/3419-android-harmony-linux
Oct 11, 2026
Merged

thymikee merged 2 commits into
mainfrom
crap/3419-android-harmony-linux

Conversation

@thymikee

@thymikee thymikee commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Covers the coverage-based CRAP findings from #3419 (part of #3414) by testing each function through its package's existing public seam — no production exports or test-only DI. Before → after CRAP:

Function Before After
emulator-lifecycle.ts normalizedAndroidBootFailureReason 30.0 5.0
emulator-lifecycle.ts buildAndroidBootFailureDetails 30.0 5.0
emulator-lifecycle.ts buildAndroidBootError 30.0 5.1
doctor.ts probeAndroidReverse 30.0 5.0
boot-diagnostics.ts bootFailureHint 35.8 10.0
hdc.ts ensureHarmonyToolchainPathConfigured 56.0 7.0
snapshot.ts rectArea 30.0 5.0

Also clears the same file's matches comparator (30.0 → 5.0) via the readLinuxTextAtPoint entry point. Boot failures exercise waitForAndroidBoot with the package's mocked adb executor; HarmonyOS PATH wiring uses a real temp toolchain layout through isExecutablePath.

Closes #3419

Validation

Head 84700ba61. pnpm check:affected --run passes (all runnable checks, 56 related tests). pnpm check:coverage-crap --all on a coverage run of the owned files reports "no function(s) at or above 30". pnpm typecheck, pnpm format clean; fallow audit finds no issues in the 5 changed files.

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.17 MB 5.17 MB 0 B
Package (unpacked) 5.17 MB 5.17 MB 0 B
Package (download) 1.55 MB 1.55 MB +3 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 17.2 ms 17.5 ms +0.2 ms
CLI --help 48.4 ms 48.9 ms +0.5 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/platform-android/src/__tests__/emulator-lifecycle.test.ts
Comment thread packages/platform-harmonyos/src/__tests__/hdc.test.ts Outdated
…d-line-tools root

Review follow-ups: make the still-booting poll actually overrun the boot
deadline, and assert HARMONYOS_COMMAND_LINE_TOOLS contributes its derived
toolchain directory to PATH.
@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 4db8a5e. It only adds tests, so no production route changes. All 18 checks pass. I read the sources to trace branch reachability. I did not run the tests, the coverage run or the CRAP check, so the before/after CRAP numbers in the PR body are unverified.

Not blocking, and you can take or leave these: the boot-timeout test in emulator-lifecycle.test.ts uses 80 ms polls against a 150 ms deadline and asserts exactly 2 calls, so about 20 ms of overshoot would leave 1 call and fail it (fake timers or a lower-bound assertion would remove the wall-clock dependence); the notEqual on BOOT_COMMAND_FAILED just after the ANDROID_BOOT_TIMEOUT equality cannot fail, and the "keeps original details" test only earns its place if the reason override is intentional; and in the Linux snapshot tests the degenerate-rect test pins nothing observable, while the missing-depth test would still pass with a default depth of 1 because the no-depth node is listed first with equal area (a depth-0 sibling with a smaller area after it would catch that).

The two earlier inline threads, on the boot-timeout test (#3433 (comment)) and on the HarmonyOS toolchain PATH order (#3433 (comment)), are fixed at this head, so please resolve them. No other open threads apply. Nothing else blocks human review.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 11, 2026
@thymikee
thymikee merged commit d0f5d49 into main Oct 11, 2026
18 checks passed
@thymikee
thymikee deleted the crap/3419-android-harmony-linux branch October 11, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CRAP: Android, HarmonyOS, Linux and provisioning diagnostics

1 participant