Disable non-reboot tests

This change fixes a build issue that was resulting in the TestActivity
being unavailable at runtime and removes the non-reboot variants of
SdCardEjectionTests until we can find a better way to detect when the
APKs on the SD card are no longer available.

Test: atest SdCardEjectionTests
Fixes: 274719632
Bug: 275403538
Change-Id: I88bd67ba5bd8ae6e4008072a5e98d1ad67085c74
This commit is contained in:
Patrick Baumann
2023-03-27 20:36:02 +00:00
parent b370c6bfe7
commit 771e98b1e5
2 changed files with 23 additions and 16 deletions

View File

@@ -57,7 +57,8 @@ class SdCardEjectionTests : BaseHostJUnit4Test() {
@Parameterized.Parameters(name = "reboot={0}")
@JvmStatic
fun parameters() = arrayOf(false, true)
// TODO(b/275403538): re-enable non-reboot scenarios with better tracking of APK removal
fun parameters() = arrayOf(/*false, */true)
data class Volume(
val diskId: String,
@@ -200,15 +201,6 @@ class SdCardEjectionTests : BaseHostJUnit4Test() {
// TODO: There must be a better way to prevent it from auto-mounting.
removeVirtualDisk()
device.reboot()
} else {
// Because PackageManager unmount scan is asynchronous, need to retry until the package
// has been unloaded. This only has to be done in the non-reboot case. Reboot will
// clear the data structure by its nature.
retryUntilSuccess {
// The compiler section will print the state of the physical APK
HostUtils.packageSection(device, pkgName, sectionName = "Compiler stats")
.any { it.contains("Unable to find package: $pkgName") }
}
}
}

View File

@@ -24,30 +24,45 @@ package {
android_test_helper_app {
name: "PackageManagerTestAppStub",
manifest: "AndroidManifestVersion1.xml",
srcs: []
srcs: [],
}
android_test_helper_app {
name: "PackageManagerTestAppVersion1",
manifest: "AndroidManifestVersion1.xml"
manifest: "AndroidManifestVersion1.xml",
srcs: [
"src/**/*.kt",
],
}
android_test_helper_app {
name: "PackageManagerTestAppVersion2",
manifest: "AndroidManifestVersion2.xml"
manifest: "AndroidManifestVersion2.xml",
srcs: [
"src/**/*.kt",
],
}
android_test_helper_app {
name: "PackageManagerTestAppVersion3",
manifest: "AndroidManifestVersion3.xml"
manifest: "AndroidManifestVersion3.xml",
srcs: [
"src/**/*.kt",
],
}
android_test_helper_app {
name: "PackageManagerTestAppVersion4",
manifest: "AndroidManifestVersion4.xml"
manifest: "AndroidManifestVersion4.xml",
srcs: [
"src/**/*.kt",
],
}
android_test_helper_app {
name: "PackageManagerTestAppOriginalOverride",
manifest: "AndroidManifestOriginalOverride.xml"
manifest: "AndroidManifestOriginalOverride.xml",
srcs: [
"src/**/*.kt",
],
}