Hive
feat(prelude): add Rust and Android test targets
GitHub issue · Closed
What changed
- Added
rust_testfor Rust test crates compiled withrustc --testand reported through Once’s generic test capability. - Added
android_local_testfor host-side Java and Kotlin tests that run on the Java virtual machine. - Added
android_instrumentation_testplusandroid_binary.attrs.instrumentsfor device or emulator tests that install the app package and test package, then runam instrumentthrough Android Debug Bridge (adb). - Shipped module-owned starter examples, schema coverage, reference pages, and Android and Rust guide updates.
- Expanded ShellSpec end-to-end coverage for Rust tests, Kotlin local tests, and Android instrumentation tests.
Why
Once could build Android and Rust targets, but the test capability was missing for those ecosystems. Rust tests still needed to run through Cargo outside Once, Kotlin tests had no Once target kind, and Android instrumentation tests were still marked unsupported. This gives those workflows first-class, discoverable target kinds with normalized Once test results.
Approach
The target kinds keep local and device-backed tests separate. Local Android tests compile test classes and run a small host runner. Instrumentation tests follow the shape used by Bazel Android instrumentation tests and Buck2 Android instrumentation tests: the test package is an Android application package target that declares which app it instruments, and the instrumentation target depends on both packages explicitly.
Rust tests reuse the existing Rust compile path, adding rustc --test support and a small runner that converts libtest output into once.test_results.v1.
Impact
Developers can now discover and run Rust, Kotlin local, and Android instrumentation tests through once test. The Android instrumentation action is intentionally not cacheable because it depends on external device state. Existing Android build behavior is unchanged, except Kotlin-only Android libraries no longer fail when there are no Java sources to compile.
Validation
mise exec -- cargo test -p once-frontend --test preludemise exec -- cargo test -p once-frontend --test examplesmise exec -- cargo fmt --all -- --checkmise exec -- cargo build --releasemise exec -- shellspec spec/test_capability_spec.shgit diff --check
Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.
Start a Flight and preserve its objective, outcome, and session here.
No GitHub comments yet.