Android Test
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Run an Android/Kotlin project’s JUnit 4 unit test suite through the Android Gradle Plugin’s testDebugUnitTest
task, scoped to whatever the caller asked for — the whole lib module, a single class, a class+method, a
wildcard/package pattern, or a lib/app module path — and, only when explicitly asked and a device or emulator
is actually attached, connectedAndroidTest instrumented tests too. A ui selector instead runs the UI tests of the
catalog’s UI contract (see Building user interfaces). This is a read-only reporting skill: it runs
tests and parses the generated JUnit XML into a compact summary, it does not fix failures or modify source/test
code unless asked to as an explicit follow-up.
Purpose
iru-android-test turns a loosely-specified request ("run FooTest", "just the lib tests", "everything") into the
correct ./gradlew … testDebugUnitTest --tests … invocation, resolving both the Gradle module (:lib vs.
:app) and the --tests filter from a single selector argument. It exists so that running and narrowing down
Android unit tests doesn’t require hand-composing Gradle --tests syntax each time, and so that a calling skill
(or a human) gets back a short pass/fail report parsed from JUnit XML instead of a raw Gradle log — while also
gating the (slower, environment-dependent) instrumented-test path behind an explicit ask and an attached
device/emulator, so it’s never run by accident.
UI runs (ui selector)
ui: jvm|device|all, or a selector starting with the word ui (ui, ui OrderRowTest; bare ui means all), runs the
UI tests (Step 4b) instead of the plain unit run:
-
JVM stage — Robolectric + Roborazzi component/screen tests through
testDebugUnitTest, no emulator needed; they capture through the module’stesting/UiScreenshots.kthelper. -
Device stage — instrumented Espresso/Compose flow tests through
connectedDebugAndroidTestwith theuiAccessibilityrunner argument, only whenadb deviceslists an attached device; otherwise the stage is reported unverified (never passed). Captures are collected from AGP’s additional test output (oradb pull) into the same layout. -
UI_SCREENSHOTS_DIRis exported (default<repo root>/.ui-screenshots) and cleared only at the start of a full, unscoped UI run; a scoped run adds to it. -
The accessibility level (
enforce/report/off/none) comes from.ui-quality.yml; a bundled parser validates every capture name against<kind>/<Id>/<state>--<direction>--<theme>[--<variant>…].png, counts captures per kind and Accessibility Test Framework results by check id.
Kotlin Multiplatform projects are out of scope: when the Kotlin Multiplatform plugin is applied anywhere in the build (a KMP app’s Android host module included), the skill stops and hands the request to KMP Test instead.
Plugin
Shipped by the iru-android plugin of the ai-catalog marketplace (install with /plugin install iru-android@ai-catalog; see Plugins).
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
A class name ( |
None — omitting it runs the whole |
Selector-to-module mapping (Step 1):
| Selector shape | Module |
|---|---|
No selector |
|
Path containing |
|
Path containing |
|
Bare class name/pattern, no path |
Search |
Selector-to---tests mapping (Step 2):
| What the user wants | --tests value |
|---|---|
Everything in the module |
(omit |
One class |
|
One method |
|
Several classes/methods |
Repeat |
Wildcard/package pattern |
|
An unmatched --tests pattern fails the whole build (Gradle exits non-zero with "No tests found for given
includes"), which the skill reports as "no matching tests for <pattern>`" — never as "0 passed, 0 failed". The
prompt (not necessarily the selector) can also ask for instrumented/on-device tests; those only run when a
device/emulator is actually attached (`adb devices lists a device-state line), and the skill says explicitly
when it skips them.
Outputs
-
A plain-text summary in the conversation — never a written file.
-
Total tests run, passed, failed, and skipped counts (parsed from
<module>/build/test-results/testDebugUnitTest/*.xml). -
If everything passed: a brief confirmation, without a per-test list.
-
If there are failures/errors: each failing test’s
classname#name, its assertion/exception message, and the first stack-trace line, pointing to the JUnit XML file for the full trace instead of pasting it. -
If instrumented tests were requested but skipped (no device attached): an explicit note, not a silent omission.
-
For a UI run: the JVM and device stages reported separately (pass/fail counts, or unverified with the reason), screenshot counts per kind (
component/screen/flow) under.ui-screenshots/, malformed capture names, accessibility results per check id and the tests they failed, the.ui-quality.ymllevel applied, and whether the directory was cleared or added to — never the screenshots, logcat or accessibility dumps. -
No source or test code is ever modified.
Execution flow
Dependencies
Invokes
None — iru-android-test is a leaf skill; it only runs Gradle/adb commands and parses the resulting JUnit XML,
it does not call any other skill in this catalog.
It stops and redirects Kotlin Multiplatform projects to KMP Test (a hand-off, not an invocation).
Invoked by
-
Android Code One Task Group — Step 3.3, via the
iru-gate-runneragent, to run the scoped unit tests for every class the task-group bucket affected, per Gradle module. -
Android Generate All Tests — Step 7, to run the newly-generated tests it wrote and confirm they pass.
-
React Native Code One Task Group — Step 3, only when the app’s
android/directory can be targeted as the Gradle root (otherwise it runstestDebugUnitTestdirectly), to run the JVM unit tests of the React Native app’s Android side.
Related agents
-
iru-gate-runner—iru-android-code-one-task-group(see Android Code One Task Group) always invokes this skill from inside airu-gate-runnersub-agent it spawns, not inline.
Source
SKILL.md on GitHub — the file this page was generated from.