Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,24 @@ internal class DeviceRunController(
val deviceActions = mutableListOf<DeviceAction>()

// App installation
deviceActions.add(
DeviceAction(
androidInstallPackages = AndroidInstallPackagesDeviceAction(
targetApp = appApk?.let {
AndroidInstallable(
files = listOf(InputFile(gcsInputFile = GcsPath(path = appApk.gcsPath.path)))
)
},
postTargetAppInstallables = deviceSetup?.additionalApks?.map {
AndroidInstallable(
files = listOf(InputFile(gcsInputFile = GcsPath(path = it.gcsPath.path)))
)
}
if (appApk != null || deviceSetup?.additionalApks?.isNotEmpty() == true) {
Comment thread
rnakade marked this conversation as resolved.
Resolved
deviceActions.add(
DeviceAction(
androidInstallPackages = AndroidInstallPackagesDeviceAction(
targetApp = appApk?.let {
AndroidInstallable(
files = listOf(InputFile(gcsInputFile = GcsPath(path = appApk.gcsPath.path)))
)
},
postTargetAppInstallables = deviceSetup?.additionalApks?.map {
AndroidInstallable(
files = listOf(InputFile(gcsInputFile = GcsPath(path = it.gcsPath.path)))
)
}
)
)
)
)
}

// Orientation & Locale
deviceActions.add(DeviceAction(androidOrientation = AndroidOrientationDeviceAction(orientation = orientation)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,30 @@ internal class DeviceRunControllerTest {
assertThat(postInstallPaths).containsExactly(extraApk1.gcsPath.path, extraApk2.gcsPath.path).inOrder()
}

@Test
fun testSubmitTests_noAdditionalApks() = runBlocking {
val testApk = createUploadedApk("test.apk")
val devices = listOf(AndroidDevice("tokay", "34", "en_US", "portrait"))

val session = controller.submitTests(
appApk = null,
testApk = testApk,
devicePicker = { devices },
deviceSetup = DeviceSetup(),
pullScreenshots = false,
testTargets = null,
flakyTestAttempts = 0,
testTimeoutSeconds = 900,
gcsResultPath = "gs://results",
gcsSmartShardingFilePath = "gs://smartShardingFile"
)

val job = session.sessionConfig.jobConfigs.first()
val installPackages = job.allocationConfig.deviceConfigs.first().actions
?.firstNotNullOfOrNull { it.androidInstallPackages }
assertThat(installPackages).isNull()
}

@Test
fun testSubmitTests_pullScreenshotsAndDirectoriesToPull() = runBlocking {
val appApk = createUploadedApk("app.apk")
Expand Down
Loading