Skip to content

Testing capabilities

Jugg can run Android instrumentation tests while preserving incremental compilation and deployment. Users can determine whether the current scenario is supported from four perspectives: app androidTest, self-targeting library androidTest, the test results tree, and method-level logcat.

Capability entry points

User scenarioCurrent supportEntry point
Run instrumentation tests for an app moduleSupportedApplication Android Test
Run self-targeting instrumentation tests for a library moduleSupportedLibrary Android Test
View the test tree, failed nodes, and rerun failed tests in the Run windowSupportedTest Results UI
Attribute logcat to a specific test methodSupportedLogcat attribution

IMPORTANT

Before entering Android Test mode for the first time, enable Android Test in the Jugg App Run Configuration and complete one full Gradle build for the Android Test target. This gives Jugg the app APK, test APK, runner, and test-module information it needs.

How test execution takes effect

text
Select a test entry point
  -> Android Test RunSpec records a sourcePath, class, or method
  -> BuildTarget switches to ANDROID_TEST
  -> Compile app and androidTest artifacts
  -> Deploy app APK / test APK according to APK ownership
  -> Run am instrument after deployment succeeds
  -> Display the test tree, failures, and method-level logcat in the Run window

Application Android Test is the most common entry point and applies to src/androidTest in an app module. Library Android Test handles libraries with an independent self-targeting Test APK, with emphasis on adding and installing the correct Test APK. Both test types ultimately run through instrumentation and share the Test Results UI and logcat attribution capabilities.

Current boundaries

ScenarioCurrent behavior
App source changeSupported by Android Test incremental compilation and deployment
app/src/androidTest source changeSupported by Android Test incremental compilation and deployment
Self-targeting library src/androidTest source changeSupported; adds the Test APK when needed
Incremental compilation of androidTest resourcesNot currently covered
androidTestAnnotationProcessor / androidTestKaptNot currently covered
Debug ExecutorNot currently covered