Skip to content

Commit

Permalink
Add a paramter to specify testTimeout in FTL controller. (#83)
Browse files Browse the repository at this point in the history
* Add a paramter to specify testTimeout in FTL controller.

* Update testTimeout to int

* update parameter name
  • Loading branch information
rnakade authored Sep 17, 2024
1 parent a0b7ec1 commit 7b847e1
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,
testTimeoutSeconds: Int = 2700
): 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,
testTimeoutSeconds = testTimeoutSeconds
)
}
}
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,
testTimeoutSeconds: Int = 2700
): 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,
testTimeoutSeconds = testTimeoutSeconds
)
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,
testTimeoutSeconds: Int = 2700
): 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 = "${testTimeoutSeconds}s",
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,
testTimeoutSeconds: Int = 2700
): 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,
testTimeoutSeconds: Int
): 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,
testTimeoutSeconds = testTimeoutSeconds
)
return TestRunnerService.ScheduleTestsResponse.create(
testMatrices
Expand Down

0 comments on commit 7b847e1

Please sign in to comment.