Android Testing And Lint Workflow
Purpose
Run the narrowest useful Android tests and lint checks, explain failures clearly, and route emulator/device validation to the Android testing plugin.
The practical decision is which module, source set, variant, and task prove the work without turning every change into a full device run.
Source Check
Use repo-local Gradle files, test files, lint config, checked-out dependency sources, and Dash.app docsets opportunistically for exact Gradle or Java questions. Use official documentation as authority for Android-specific testing and lint behavior:
Translate documentation into concrete test source sets, Gradle tasks, variants, and failure modes.
Inspection Workflow
- Identify test layout:
src/test
src/androidTest
- Compose UI test files
- fixture, fake, mock, and dependency-injection test support
- Identify lint setup:
lint.xml
- lint baselines
- Gradle lint options
- CI lint commands
- Identify affected variants:
- debug versus release
- product flavors
- application versus library modules
- Identify validation level:
- local unit tests for JVM-only behavior
- instrumentation tests for Android runtime behavior
- Compose UI tests for UI semantics and interactions
- lint for resources, APIs, permissions, lifecycle, accessibility, and manifest issues
- emulator/device validation handoff when runtime proof is required
Command Selection
Start narrow, then widen:
./gradlew :app:testDebugUnitTest
./gradlew :app:lintDebug
./gradlew :app:connectedDebugAndroidTest
Use connected or managed-device tasks only when the user requested device validation or the change cannot be proved locally. If emulator operation is needed, hand off to the Android testing plugin instead of duplicating device-control steps here.
Run one Gradle command at a time.
Failure Triage
Classify failures by first concrete break:
- Gradle setup or dependency resolution
- compile, KSP, KAPT, or generated-source failure
- local unit test failure
- instrumentation setup failure
- instrumentation assertion failure
- Compose UI semantics, synchronization, or interaction failure
- lint configuration or baseline failure
- lint finding from changed code
- emulator/device availability issue
Report the command, module, variant, source set, first meaningful error, likely cause, and smallest next check.
Lint Policy
- Preserve existing baseline policy.
- Do not update a baseline just to hide a new issue.
- Treat accessibility, permissions, exported components, manifest, resource, and API-level findings as user-facing risk until understood.
- Keep suppressions local and justified when the repo already allows suppressions.
Output Shape
Return:
Test scope: module, source set, variant, unit, instrumentation, Compose UI, or lint.
Commands: exact commands run or recommended.
Result: pass, fail, or skipped with concrete reason.
Failure mode: setup, compile, unit, instrumentation, Compose UI, lint config, lint finding, or emulator/device issue.
Next check: smallest code, test, lint, Gradle, or Android testing plugin handoff.
Guardrails
- Do not run broad device tests first when unit tests or lint prove the change.
- Do not start emulator or device automation directly from this skill.
- Do not rewrite or remove lint baselines without explaining the policy impact.
- Do not weaken tests to match broken behavior.
- Do not run Gradle commands concurrently.
1---2name: testing-lint-workflow3description: Plan, run, filter, and triage Android tests and lint, including local unit tests, instrumentation and Compose UI test handoffs, Gradle variant tasks, lint configuration, lint baselines, failure explanations, emulator-aware validation routing, and readable next checks.4license: Apache-2.05---67# Android Testing And Lint Workflow89## Purpose1011Run the narrowest useful Android tests and lint checks, explain failures clearly, and route emulator/device validation to the Android testing plugin.1213The practical decision is which module, source set, variant, and task prove the work without turning every change into a full device run.1415## Source Check1617Use repo-local Gradle files, test files, lint config, checked-out dependency sources, and Dash.app docsets opportunistically for exact Gradle or Java questions. Use official documentation as authority for Android-specific testing and lint behavior:1819- [Test apps on Android](https://developer.android.com/training/testing)20- [Android build documentation](https://developer.android.com/build)21- [Android lint documentation](https://developer.android.com/studio/write/lint)22- [Jetpack Compose testing documentation](https://developer.android.com/develop/ui/compose/testing)23- [Gradle User Manual](https://docs.gradle.org/current/userguide/userguide.html)2425Translate documentation into concrete test source sets, Gradle tasks, variants, and failure modes.2627## Inspection Workflow28291. Identify test layout:30 - `src/test`31 - `src/androidTest`32 - Compose UI test files33 - fixture, fake, mock, and dependency-injection test support342. Identify lint setup:35 - `lint.xml`36 - lint baselines37 - Gradle lint options38 - CI lint commands393. Identify affected variants:40 - debug versus release41 - product flavors42 - application versus library modules434. Identify validation level:44 - local unit tests for JVM-only behavior45 - instrumentation tests for Android runtime behavior46 - Compose UI tests for UI semantics and interactions47 - lint for resources, APIs, permissions, lifecycle, accessibility, and manifest issues48 - emulator/device validation handoff when runtime proof is required4950## Command Selection5152Start narrow, then widen:5354```bash55./gradlew :app:testDebugUnitTest56./gradlew :app:lintDebug57./gradlew :app:connectedDebugAndroidTest58```5960Use connected or managed-device tasks only when the user requested device validation or the change cannot be proved locally. If emulator operation is needed, hand off to the Android testing plugin instead of duplicating device-control steps here.6162Run one Gradle command at a time.6364## Failure Triage6566Classify failures by first concrete break:6768- Gradle setup or dependency resolution69- compile, KSP, KAPT, or generated-source failure70- local unit test failure71- instrumentation setup failure72- instrumentation assertion failure73- Compose UI semantics, synchronization, or interaction failure74- lint configuration or baseline failure75- lint finding from changed code76- emulator/device availability issue7778Report the command, module, variant, source set, first meaningful error, likely cause, and smallest next check.7980## Lint Policy8182- Preserve existing baseline policy.83- Do not update a baseline just to hide a new issue.84- Treat accessibility, permissions, exported components, manifest, resource, and API-level findings as user-facing risk until understood.85- Keep suppressions local and justified when the repo already allows suppressions.8687## Output Shape8889Return:90911. `Test scope`: module, source set, variant, unit, instrumentation, Compose UI, or lint.922. `Commands`: exact commands run or recommended.933. `Result`: pass, fail, or skipped with concrete reason.944. `Failure mode`: setup, compile, unit, instrumentation, Compose UI, lint config, lint finding, or emulator/device issue.955. `Next check`: smallest code, test, lint, Gradle, or Android testing plugin handoff.9697## Guardrails9899- Do not run broad device tests first when unit tests or lint prove the change.100- Do not start emulator or device automation directly from this skill.101- Do not rewrite or remove lint baselines without explaining the policy impact.102- Do not weaken tests to match broken behavior.103- Do not run Gradle commands concurrently.