Hive Hive
Sign in

feat(prelude): add Rust and Android test targets

GitHub issue · Closed

Metadata
Source
tuist/once #152
Updated
Jul 5, 2026
Domains
Once
Details

What changed

  • Added rust_test for Rust test crates compiled with rustc --test and reported through Once’s generic test capability.
  • Added android_local_test for host-side Java and Kotlin tests that run on the Java virtual machine.
  • Added android_instrumentation_test plus android_binary.attrs.instruments for device or emulator tests that install the app package and test package, then run am instrument through 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 prelude
  • mise exec -- cargo test -p once-frontend --test examples
  • mise exec -- cargo fmt --all -- --check
  • mise exec -- cargo build --release
  • mise exec -- shellspec spec/test_capability_spec.sh
  • git diff --check
Flights

Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.

New Flights are paused Configure model inference, GitHub, and a sandbox provider to start another Flight. Existing results remain available below.
No Flights yet

Start a Flight and preserve its objective, outcome, and session here.

Comments

No GitHub comments yet.