From 51cf60d6046abdab9d1db2d20ea09e9fe5fb3140 Mon Sep 17 00:00:00 2001 From: Ben Trengrove Date: Mon, 9 Dec 2024 10:50:29 +1100 Subject: [PATCH] Fix ui tests --- .idea/deploymentTargetSelector.xml | 20 +++++++++----------- navigation-animation/build.gradle.kts | 8 ++++++++ navigation-material/build.gradle.kts | 8 ++++++++ permissions/build.gradle.kts | 7 +++++++ 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml index 38d5081d2..87bd97165 100644 --- a/.idea/deploymentTargetSelector.xml +++ b/.idea/deploymentTargetSelector.xml @@ -2,23 +2,21 @@ - - + + + + + + \ No newline at end of file diff --git a/navigation-animation/build.gradle.kts b/navigation-animation/build.gradle.kts index d312fc4f3..c562aef03 100644 --- a/navigation-animation/build.gradle.kts +++ b/navigation-animation/build.gradle.kts @@ -23,6 +23,14 @@ plugins { android { namespace = "com.google.accompanist.navigation.animation" + + packaging { + // Some of the META-INF files conflict with coroutines-test. Exclude them to enable + // our test APK to build (has no effect on our AARs) + resources { + excludes += listOf("/META-INF/AL2.0", "/META-INF/LGPL2.1") + } + } } dependencies { diff --git a/navigation-material/build.gradle.kts b/navigation-material/build.gradle.kts index b24487f1e..f657d430a 100644 --- a/navigation-material/build.gradle.kts +++ b/navigation-material/build.gradle.kts @@ -23,6 +23,14 @@ plugins { android { namespace = "com.google.accompanist.navigation.material" + + packaging { + // Some of the META-INF files conflict with coroutines-test. Exclude them to enable + // our test APK to build (has no effect on our AARs) + resources { + excludes += listOf("/META-INF/AL2.0", "/META-INF/LGPL2.1") + } + } } dependencies { diff --git a/permissions/build.gradle.kts b/permissions/build.gradle.kts index c891301cf..0c1a8ee2c 100644 --- a/permissions/build.gradle.kts +++ b/permissions/build.gradle.kts @@ -24,6 +24,13 @@ plugins { android { namespace = "com.google.accompanist.permissions" + defaultConfig { + // The following argument makes the Android Test Orchestrator run its + // "pm clear" command after each test invocation. This command ensures + // that the app's state is completely cleared between tests. + testInstrumentationRunnerArguments["clearPackageData"] = "true" + } + testOptions { execution = "ANDROIDX_TEST_ORCHESTRATOR" }