Skip to content

Application Android Test

Jugg supports Android instrumentation tests in app modules. After Android Test is enabled, both app source and app/src/androidTest source can enter Jugg's Android Test compilation, deployment, and instrumentation flow.

Run entry points and supported scope

Run entry pointCurrent supportResult
Run Android Test from a Jugg App Run ConfigurationSupportedRuns instrumentation after compilation and deployment
Run from a class gutter in src/androidTestSupportedRuns the selected test class
Run from a method gutter in src/androidTestSupportedRuns the selected test method
Rerun after changing app sourceSupportedDeploys compilation artifacts to the app APK
Rerun after changing app androidTest sourceSupportedDeploys compilation artifacts to the corresponding test target
Rerun failed testsSupportedReruns only failed leaf tests

IMPORTANT

Jugg does not automatically modify the App Run Configuration when a user clicks a gutter icon. Enable Android Test manually and complete one full Gradle build for the Android Test target first.

How Android Test runs

text
Enable Android Test in the App Run Configuration
  -> BuildTarget switches to ANDROID_TEST
  -> A full Gradle build produces the app APK and app test APK
  -> Later app / androidTest source changes enter incremental compilation
  -> Deployment writes artifacts to the app APK or test APK according to APK ownership
  -> Run am instrument after deployment succeeds

Jugg uses sourcePath as the test-target anchor. A class gutter creates a class-level target, and a method gutter creates a method-level target. Rerun failed tests converts failed nodes into new test filters without writing the scope back to the General page.

Target and APK ownership

Android Test mode uses BuildTarget.ANDROID_TEST. This target means that the current run session must consider both app and androidTest artifacts; it does not turn androidTest into an independent app.

Deployment continues to use the current install, Code Swap, or Full Swap strategy and splits deployment data by APK ownership. App-style androidTest runs in the process of the app under test. For self-targeting library Test APKs, see Library Android Test.

Current boundaries

ScenarioCurrent behavior
org.junit.TestSupported for gutter detection
org.junit.jupiter.api.TestSupported for gutter detection
Java / Kotlin test filesSupported
Custom androidTest source rootSupported through source-root detection
Incremental compilation of androidTest resourcesNot currently covered
androidTestAnnotationProcessor / androidTestKaptNot currently covered
Persistent test harness or redefinition in the test processNot currently covered
Debug ExecutorNot currently covered