Multi-module testing
Multi module testing can be done by manually specifying additionalTestApks or applying the Fulladle plugin to automacally gather all the additional test apks. See also this article for a full setup and instructions including integration with CI.
Fulladle Plugin
-
Apply the Fulladle plugin at the root of the project.
plugins { id 'com.osacky.fulladle' version '0.20.0' }plugins { id("com.osacky.fulladle") version "0.20.0" } -
Configure the Fladle extension.
fladle { serviceAccountCredentials = project.layout.projectDirectory.file("flank-gradle-service-account.json") }fladle { serviceAccountCredentials.set(project.layout.projectDirectory.file("flank-gradle-service-account.json")) }Warning
If using buildFlavors or testing against a non default variant, you will need to specify the variant you want to test in the fulladleModuleConfig block.
-
Run the tests. First assemble all your debug apks and test apks.
./gradlew assembleDebug assembleDebugAndroidTestNote
When using flavors, make sure to assemble your buildVariants as well.
./gradlew :app:assembleFreeDebug :app:assembleFreeDebugAndroidTestRun Flank!
./gradlew runFlank
Overriding configurations in modules
Fulladle will pick Flank configurations from the fladle block in the root build.gradle file. You may want to override some of these configurations for certain modules, you can add the following block to any Android library module to override its configurations:
fulladleModuleConfig {
clientDetails = [
"test-type": "PR",
"build-number": "132"
]
maxTestShards = 3
environmentVariables = [
"clearPackageData": "true"
]
debugApk = "app.apk"
variant = "vanillaDebug"
}
fulladleModuleConfig {
clientDetails.set(mapOf(
"test-type" to "PR",
"build-number" to "132",
))
maxTestShards.set(3)
environmentVariables.set(mapOf(
"clearPackageData" to "true"
))
debugApk.set("app.apk")
variant.set("vanillaDebug")
}
All of the above configurations are optional, Flank will default to the top-level configurations if you don't override anything here. For details about these configurations, refer to