From b007f9c6784856168a156bf587c7313bf88f7a0f Mon Sep 17 00:00:00 2001 From: Ben Weiss Date: Thu, 18 Apr 2024 10:14:34 +0200 Subject: [PATCH] Revert to API 33 GMD and fail empty screen tests Change-Id: Ib0aeb35aa43b5e1d949652123ae9a5a480c40822 --- app/build.gradle.kts | 2 +- benchmarks/build.gradle.kts | 6 +++--- .../samples/apps/nowinandroid/foryou/ForYouActions.kt | 5 +++-- .../samples/apps/nowinandroid/interests/InterestsActions.kt | 4 +++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3dead8cfb..6e2d9618b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -52,7 +52,7 @@ android { // To publish on the Play store a private signing key is required, but to allow anyone // who clones the code to sign and run the release variant, use the debug signing key. // TODO: Abstract the signing configuration to a separate file to avoid hardcoding this. - signingConfig = signingConfigs.getByName("debug").get() + signingConfig = signingConfigs.getByName("debug") } } diff --git a/benchmarks/build.gradle.kts b/benchmarks/build.gradle.kts index b9856bdf5..6ff797c2b 100644 --- a/benchmarks/build.gradle.kts +++ b/benchmarks/build.gradle.kts @@ -47,9 +47,9 @@ android { } testOptions.managedDevices.devices { - create("pixel6Api31") { + create("pixel6Api33") { device = "Pixel 6" - apiLevel = 31 + apiLevel = 33 systemImageSource = "aosp" } } @@ -60,7 +60,7 @@ android { baselineProfile { // This specifies the managed devices to use that you run the tests on. - managedDevices += "pixel6Api31" + managedDevices += "pixel6Api33" // Don't use a connected device but rely on a GMD for consistency between local and CI builds. useConnectedDevices = false diff --git a/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/foryou/ForYouActions.kt b/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/foryou/ForYouActions.kt index 6706bb97b..ced2bc803 100644 --- a/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/foryou/ForYouActions.kt +++ b/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/foryou/ForYouActions.kt @@ -24,6 +24,7 @@ import androidx.test.uiautomator.untilHasChildren import com.google.samples.apps.nowinandroid.flingElementDownUp import com.google.samples.apps.nowinandroid.waitAndFindObject import com.google.samples.apps.nowinandroid.waitForObjectOnTopAppBar +import org.junit.Assert.fail private const val TAG = "ForYouActions" @@ -46,8 +47,8 @@ fun MacrobenchmarkScope.forYouSelectTopics(recheckTopicsIfChecked: Boolean = fal val withChildren = topics.childCount != 0 if (!withChildren) { // TODO: Ensure ForYou has topics. - Log.w(TAG, "no topics found, can't scroll for baseline profile generation.") - return + Log.e(TAG, "no topics found, can't scroll for baseline profile generation.") + fail() } // Set gesture margin from sides not to trigger system gesture navigation diff --git a/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsActions.kt b/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsActions.kt index db7b46c8c..6494e0114 100644 --- a/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsActions.kt +++ b/benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsActions.kt @@ -22,6 +22,7 @@ import androidx.test.uiautomator.By import androidx.test.uiautomator.Until import com.google.samples.apps.nowinandroid.flingElementDownUp import com.google.samples.apps.nowinandroid.waitForObjectOnTopAppBar +import org.junit.Assert.fail private const val TAG = "InterestsActions" @@ -42,7 +43,8 @@ fun MacrobenchmarkScope.interestsScrollTopicsDownUp() { // TODO: Ensure topics are availble. device.flingElementDownUp(topicsList) } else { - Log.w(TAG, "No topics found, can't scroll during baseline profile generation.") + Log.e(TAG, "No topics found, can't scroll during baseline profile generation.") + fail() } }