@@ -108,6 +108,8 @@ class AndroidArgsTest {
108
108
max-test-shards: 7
109
109
shard-time: 60
110
110
num-test-runs: 8
111
+ default-test-time: 15.0
112
+ use-average-test-time-for-new-tests: true
111
113
files-to-download:
112
114
- /sdcard/screenshots
113
115
- /sdcard/screenshots2
@@ -317,6 +319,8 @@ AndroidArgs
317
319
num-test-runs: 8
318
320
smart-flank-gcs-path:${' ' }
319
321
smart-flank-disable-upload: false
322
+ default-test-time: 15.0
323
+ use-average-test-time-for-new-tests: true
320
324
files-to-download:
321
325
- /sdcard/screenshots
322
326
- /sdcard/screenshots2
@@ -382,6 +386,8 @@ AndroidArgs
382
386
num-test-runs: 1
383
387
smart-flank-gcs-path:
384
388
smart-flank-disable-upload: false
389
+ default-test-time: 120.0
390
+ use-average-test-time-for-new-tests: false
385
391
files-to-download:
386
392
test-targets-always-run:
387
393
disable-sharding: false
@@ -1676,6 +1682,61 @@ AndroidArgs
1676
1682
""" .trimIndent()
1677
1683
AndroidArgs .load(yaml)
1678
1684
}
1685
+
1686
+ @Test
1687
+ fun `should set defaultTestTime` () {
1688
+ val yaml = """
1689
+ gcloud:
1690
+ app: $appApk
1691
+ test: $testApk
1692
+ flank:
1693
+ max-test-shards: -1
1694
+ default-test-time: 15
1695
+ """ .trimIndent()
1696
+ val args = AndroidArgs .load(yaml)
1697
+ assertEquals(args.defaultTestTime, 15.0 , 0.01 )
1698
+ }
1699
+
1700
+ @Test
1701
+ fun `should set defaultTestTime to default value if not specified` () {
1702
+ val yaml = """
1703
+ gcloud:
1704
+ app: $appApk
1705
+ test: $testApk
1706
+ flank:
1707
+ max-test-shards: -1
1708
+ use-average-test-time-for-new-tests: true
1709
+ """ .trimIndent()
1710
+ val args = AndroidArgs .load(yaml)
1711
+ assertEquals(args.defaultTestTime, 120.0 , 0.01 )
1712
+ }
1713
+
1714
+ @Test
1715
+ fun `should useAverageTestTimeForNewTests set to true` () {
1716
+ val yaml = """
1717
+ gcloud:
1718
+ app: $appApk
1719
+ test: $testApk
1720
+ flank:
1721
+ max-test-shards: -1
1722
+ use-average-test-time-for-new-tests: true
1723
+ """ .trimIndent()
1724
+ val args = AndroidArgs .load(yaml)
1725
+ assertTrue(args.useAverageTestTimeForNewTests)
1726
+ }
1727
+
1728
+ @Test
1729
+ fun `should useAverageTestTimeForNewTests set to false by defaul` () {
1730
+ val yaml = """
1731
+ gcloud:
1732
+ app: $appApk
1733
+ test: $testApk
1734
+ flank:
1735
+ max-test-shards: -1
1736
+ """ .trimIndent()
1737
+ val args = AndroidArgs .load(yaml)
1738
+ assertFalse(args.useAverageTestTimeForNewTests)
1739
+ }
1679
1740
}
1680
1741
1681
1742
private fun AndroidArgs.Companion.load (yamlData : String , cli : AndroidRunCommand ? = null): AndroidArgs =
0 commit comments