Skip to content

Commit

Permalink
Add a paramter to specify testTimeout in FTL controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
rnakade committed Sep 16, 2024
1 parent 178298f commit 9be9090
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ internal class FirebaseTestLabController(
pullScreenshots: Boolean = false,
cachedTestMatrixFilter: CachedTestMatrixFilter,
testTargets: List<String>? = null,
flakyTestAttempts: Int = 2
flakyTestAttempts: Int = 2,
testTimeout: String = "2700s"
): List<TestMatrix> {
val devices = (devicePicker ?: defaultDevicePicker).pickDevices()
logger.info {
Expand All @@ -129,7 +130,8 @@ internal class FirebaseTestLabController(
pullScreenshots = pullScreenshots,
cachedTestMatrixFilter = cachedTestMatrixFilter,
testTargets = testTargets,
flakyTestAttempts = flakyTestAttempts
flakyTestAttempts = flakyTestAttempts,
testTimeout = testTimeout
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ internal class TestMatrixStore(
pullScreenshots: Boolean = false,
cachedTestMatrixFilter: CachedTestMatrixFilter = { true },
testTargets: List<String>? = null,
flakyTestAttempts: Int = 2
flakyTestAttempts: Int = 2,
testTimeout: String = "2700s"
): TestMatrix {

val testRunId = TestRun.createId(
Expand Down Expand Up @@ -101,7 +102,8 @@ internal class TestMatrixStore(
testApk = testApk,
pullScreenshots = pullScreenshots,
testTargets = testTargets,
flakyTestAttempts = flakyTestAttempts
flakyTestAttempts = flakyTestAttempts,
testTimeout = testTimeout
)
logger.info {
"created test matrix: $newTestMatrix"
Expand Down Expand Up @@ -260,7 +262,8 @@ internal class TestMatrixStore(
testApk: UploadedApk,
pullScreenshots: Boolean = false,
testTargets: List<String>? = null,
flakyTestAttempts: Int = 2
flakyTestAttempts: Int = 2,
testTimeout: String = "2700s"
): TestMatrix {
val packageName = firebaseTestLabApi.getApkDetails(
FileReference(
Expand Down Expand Up @@ -288,7 +291,7 @@ internal class TestMatrixStore(
)
}
val testSpecification = TestSpecification(
testTimeout = "2700s", // Limit for physical devices.
testTimeout = testTimeout,
disableVideoRecording = false,
disablePerformanceMetrics = true, // Not a useful feature for androidx
androidInstrumentationTest = AndroidInstrumentationTest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ interface TestRunnerService {
pullScreenshots: Boolean = false,
cachedTestMatrixFilter: CachedTestMatrixFilter = { true },
testTargets: List<String>? = null,
flakyTestAttempts: Int = 2
flakyTestAttempts: Int = 2,
testTimeout: String = "2700s"
): ScheduleTestsResponse

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ internal class TestRunnerServiceImpl internal constructor(
pullScreenshots: Boolean,
cachedTestMatrixFilter: CachedTestMatrixFilter,
testTargets: List<String>?,
flakyTestAttempts: Int
flakyTestAttempts: Int,
testTimeout: String
): TestRunnerService.ScheduleTestsResponse {
val testMatrices = testLabController.submitTests(
appApk = appApk ?: apkStore.getPlaceholderApk(),
Expand All @@ -114,7 +115,8 @@ internal class TestRunnerServiceImpl internal constructor(
pullScreenshots = pullScreenshots,
cachedTestMatrixFilter = cachedTestMatrixFilter,
testTargets = testTargets,
flakyTestAttempts = flakyTestAttempts
flakyTestAttempts = flakyTestAttempts,
testTimeout = testTimeout
)
return TestRunnerService.ScheduleTestsResponse.create(
testMatrices
Expand Down

0 comments on commit 9be9090

Please sign in to comment.