@@ -50,6 +50,33 @@ val e2eBackendEnv = System.getenv("E2E_BACKEND") ?: "local"
5050val e2eHomegateUrlEnv = System .getenv(" E2E_HOMEGATE_URL" ) ? : " http://127.0.0.1:6288"
5151val trezorBridgeEnv = System .getenv(" TREZOR_BRIDGE" )?.toBoolean()?.toString() ? : " false"
5252val trezorBridgeUrlEnv = System .getenv(" TREZOR_BRIDGE_URL" ) ? : " http://10.0.2.2:21325"
53+ val coreServiceIntegrationTestAnnotation = " to.bitkit.test.annotations.CoreServiceIntegrationTest"
54+ val composeUiTestAnnotation = " to.bitkit.test.annotations.ComposeUiTest"
55+ val deviceIntegrationTestAnnotation = " to.bitkit.test.annotations.DeviceIntegrationTest"
56+ val deviceStorageIntegrationTestAnnotation = " to.bitkit.test.annotations.DeviceStorageIntegrationTest"
57+ val deviceUiIntegrationTestAnnotation = " to.bitkit.test.annotations.DeviceUiIntegrationTest"
58+ val requestedTaskNames = gradle.startParameter.taskNames.map { it.substringAfterLast(" :" ) }
59+ val bitkitAndroidTestSuite = providers.gradleProperty(" bitkitAndroidTestSuite" ).orNull
60+ val bitkitAndroidTestAnnotation = when {
61+ requestedTaskNames.any { it == " connectedDevDebugComposeAndroidTest" } -> composeUiTestAnnotation
62+ requestedTaskNames.any { it == " connectedDevDebugCoreServiceIntegrationAndroidTest" } -> {
63+ coreServiceIntegrationTestAnnotation
64+ }
65+ requestedTaskNames.any { it == " connectedDevDebugDeviceStorageIntegrationAndroidTest" } -> {
66+ deviceStorageIntegrationTestAnnotation
67+ }
68+ requestedTaskNames.any { it == " connectedDevDebugDeviceUiIntegrationAndroidTest" } -> {
69+ deviceUiIntegrationTestAnnotation
70+ }
71+ requestedTaskNames.any { it == " connectedDevDebugDeviceIntegrationAndroidTest" } -> deviceIntegrationTestAnnotation
72+ bitkitAndroidTestSuite == " compose" -> composeUiTestAnnotation
73+ bitkitAndroidTestSuite == " core-service" -> coreServiceIntegrationTestAnnotation
74+ bitkitAndroidTestSuite == " device-storage" -> deviceStorageIntegrationTestAnnotation
75+ bitkitAndroidTestSuite == " device-ui" -> deviceUiIntegrationTestAnnotation
76+ bitkitAndroidTestSuite == " integration" -> deviceIntegrationTestAnnotation
77+ bitkitAndroidTestSuite == null -> null
78+ else -> error(" Unsupported bitkitAndroidTestSuite '$bitkitAndroidTestSuite '" )
79+ }
5380
5481android {
5582 namespace = " to.bitkit"
@@ -61,6 +88,9 @@ android {
6188 versionCode = 181
6289 versionName = " 2.2.0"
6390 testInstrumentationRunner = " to.bitkit.test.HiltTestRunner"
91+ bitkitAndroidTestAnnotation?.let {
92+ testInstrumentationRunnerArguments[" annotation" ] = it
93+ }
6494 vectorDrawables {
6595 useSupportLibrary = true
6696 }
@@ -367,4 +397,34 @@ tasks.withType<Test>().configureEach {
367397 jvmArgs(" -XX:+EnableDynamicAgentLoading" )
368398}
369399
400+ tasks.register(" connectedDevDebugComposeAndroidTest" ) {
401+ group = " verification"
402+ description = " Runs devDebug Android tests annotated as Compose UI tests."
403+ dependsOn(" connectedDevDebugAndroidTest" )
404+ }
405+
406+ tasks.register(" connectedDevDebugDeviceIntegrationAndroidTest" ) {
407+ group = " verification"
408+ description = " Runs devDebug Android tests annotated as device integration tests."
409+ dependsOn(" connectedDevDebugAndroidTest" )
410+ }
411+
412+ tasks.register(" connectedDevDebugCoreServiceIntegrationAndroidTest" ) {
413+ group = " verification"
414+ description = " Runs devDebug Android tests annotated as core service integration tests."
415+ dependsOn(" connectedDevDebugAndroidTest" )
416+ }
417+
418+ tasks.register(" connectedDevDebugDeviceStorageIntegrationAndroidTest" ) {
419+ group = " verification"
420+ description = " Runs devDebug Android tests annotated as device storage integration tests."
421+ dependsOn(" connectedDevDebugAndroidTest" )
422+ }
423+
424+ tasks.register(" connectedDevDebugDeviceUiIntegrationAndroidTest" ) {
425+ group = " verification"
426+ description = " Runs devDebug Android tests annotated as device UI integration tests."
427+ dependsOn(" connectedDevDebugAndroidTest" )
428+ }
429+
370430// endregion
0 commit comments