Skip to content

Commit 27cad6d

Browse files
Rename testRuns to repeatTests (#306)
1 parent c06bce1 commit 27cad6d

21 files changed

+38
-38
lines changed

test_runner/flank.ios.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ flank:
1515
# test shards - the amount of groups to split the test suite into
1616
# set to -1 to use one shard per test.
1717
testShards: 1
18-
# test runs - the amount of times to run the tests.
18+
# repeat tests - the amount of times to run the tests.
1919
# 1 runs the tests once. 10 runs all the tests 10x
20-
testRuns: 1
20+
repeatTests: 1
2121
# # always run - these tests are inserted at the beginning of every shard
2222
# # useful if you need to grant permissions or login before other tests run
2323
# test-targets-always-run:

test_runner/flank.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ flank:
2727
# test shards - the amount of groups to split the test suite into
2828
# set to -1 to use one shard per test.
2929
testShards: 1
30-
# test runs - the amount of times to run the tests.
30+
# repeat tests - the amount of times to run the tests.
3131
# 1 runs the tests once. 10 runs all the tests 10x
32-
testRuns: 1
32+
repeatTests: 1
3333
# # always run - these tests are inserted at the beginning of every shard
3434
# # useful if you need to grant permissions or login before other tests run
3535
# test-targets-always-run:

test_runner/src/main/kotlin/ftl/args/AndroidArgs.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class AndroidArgs(
4949

5050
private val flank = flankYml.flank
5151
val testShards = flank.testShards
52-
override val testRuns = flank.testRuns
52+
override val repeatTests = flank.repeatTests
5353
val testTargetsAlwaysRun = flank.testTargetsAlwaysRun
5454

5555
// computed properties not specified in yaml
@@ -124,7 +124,7 @@ AndroidArgs
124124
125125
flank:
126126
testShards: $testShards
127-
testRuns: $testRuns
127+
repeatTests: $repeatTests
128128
testTargetsAlwaysRun: $testTargetsAlwaysRun
129129
""".trimIndent()
130130
}

test_runner/src/main/kotlin/ftl/args/IArgs.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ interface IArgs {
44
val async: Boolean
55
val resultsBucket: String
66
val projectId: String
7-
val testRuns: Int
7+
val repeatTests: Int
88
val testShardChunks: List<List<String>>
99
}

test_runner/src/main/kotlin/ftl/args/IosArgs.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class IosArgs(
3737

3838
private val flank = flankYml.flank
3939
val testShards = flank.testShards
40-
override val testRuns = flank.testRuns
40+
override val repeatTests = flank.repeatTests
4141
val testTargetsAlwaysRun = flank.testTargetsAlwaysRun
4242

4343
private val iosFlank = iosFlankYml.flank
@@ -89,7 +89,7 @@ IosArgs
8989
9090
flank:
9191
testShards: $testShards
92-
testRuns: $testRuns
92+
repeatTests: $repeatTests
9393
testTargetsAlwaysRun: $testTargetsAlwaysRun
9494
# iOS flank
9595
testTargets: $testTargets

test_runner/src/main/kotlin/ftl/args/yml/FlankYml.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ import ftl.util.Utils.fatalError
88
@JsonIgnoreProperties(ignoreUnknown = true)
99
class FlankYmlParams(
1010
val testShards: Int = 1,
11-
val testRuns: Int = 1,
11+
val repeatTests: Int = 1,
1212

1313
@field:JsonProperty("test-targets-always-run")
1414
val testTargetsAlwaysRun: List<String> = emptyList()
1515
) {
1616
companion object : IYmlKeys {
17-
override val keys = listOf("testShards", "testRuns", "test-targets-always-run")
17+
override val keys = listOf("testShards", "repeatTests", "test-targets-always-run")
1818
}
1919

2020
init {
2121
if (testShards <= 0 && testShards != -1) fatalError("testShards must be >= 1 or -1")
22-
if (testRuns < 1) fatalError("testRuns must be >= 1")
22+
if (repeatTests < 1) fatalError("repeatTests must be >= 1")
2323
}
2424
}
2525

test_runner/src/main/kotlin/ftl/run/AndroidTestRunner.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ object AndroidTestRunner {
2222

2323
val apks = resolveApks(androidArgs, runGcsPath)
2424
val jobs = arrayListOf<Deferred<TestMatrix>>()
25-
val runCount = androidArgs.testRuns
25+
val runCount = androidArgs.repeatTests
2626
val deviceCount = androidArgs.testShardChunks.size
2727
val shardCounter = ShardCounter()
2828

test_runner/src/main/kotlin/ftl/run/GenericTestRunner.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ object GenericTestRunner {
5353
}
5454

5555
fun beforeRunMessage(args: IArgs): String {
56-
val runCount = args.testRuns
56+
val runCount = args.repeatTests
5757
val shardCount = args.testShardChunks.size
5858
val testsPerShard = args.testShardChunks.first().size
5959
val testsCount = args.testShardChunks.sumBy { it.size }

test_runner/src/main/kotlin/ftl/run/IosTestRunner.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object IosTestRunner {
3131
val xcTestParsed = Xctestrun.parse(yamlConfig.xctestrunFile)
3232

3333
val jobs = arrayListOf<Deferred<TestMatrix>>()
34-
val runCount = yamlConfig.testRuns
34+
val runCount = yamlConfig.repeatTests
3535
val deviceCount = yamlConfig.testShardChunks.size
3636
val shardCounter = ShardCounter()
3737

test_runner/src/test/kotlin/ftl/args/AndroidArgsFileTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class AndroidArgsFileTest {
8080

8181
with(config) {
8282
assert(testShards, 1)
83-
assert(testRuns, 1)
83+
assert(repeatTests, 1)
8484
}
8585
}
8686

test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class AndroidArgsTest {
4242
4343
flank:
4444
testShards: 7
45-
testRuns: 8
45+
repeatTests: 8
4646
test-targets-always-run:
4747
- class example.Test#grantPermission
4848
"""
@@ -124,7 +124,7 @@ class AndroidArgsTest {
124124

125125
// FlankYml
126126
assert(testShards, 7)
127-
assert(testRuns, 8)
127+
assert(repeatTests, 8)
128128
assert(testTargetsAlwaysRun, listOf("class example.Test#grantPermission"))
129129
}
130130
}
@@ -154,7 +154,7 @@ AndroidArgs
154154
155155
flank:
156156
testShards: 7
157-
testRuns: 8
157+
repeatTests: 8
158158
testTargetsAlwaysRun: [class example.Test#grantPermission]
159159
""".trimIndent()
160160
)
@@ -191,7 +191,7 @@ AndroidArgs
191191

192192
// FlankYml
193193
assert(testShards, 1)
194-
assert(testRuns, 1)
194+
assert(repeatTests, 1)
195195
assert(testTargetsAlwaysRun, empty)
196196
}
197197
}

test_runner/src/test/kotlin/ftl/args/FlankYmlTest.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class FlankYmlTest {
2525
fun testValidArgs() {
2626
FlankYml()
2727
FlankYml(FlankYmlParams(testShards = -1))
28-
val yml = FlankYml(FlankYmlParams(testShards = 1, testRuns = 1))
29-
assertThat(yml.flank.testRuns).isEqualTo(1)
28+
val yml = FlankYml(FlankYmlParams(testShards = 1, repeatTests = 1))
29+
assertThat(yml.flank.repeatTests).isEqualTo(1)
3030
assertThat(yml.flank.testShards).isEqualTo(1)
3131
assertThat(yml.flank.testTargetsAlwaysRun).isEqualTo(emptyList<String>())
3232
assertThat(FlankYml.map).isNotEmpty()
@@ -39,8 +39,8 @@ class FlankYmlTest {
3939
}
4040

4141
@Test
42-
fun testInvalidTestRuns() {
42+
fun testInvalidrepeatTests() {
4343
expectedExitRule.expectSystemExitWithStatus(-1)
44-
FlankYml(FlankYmlParams(testRuns = 0))
44+
FlankYml(FlankYmlParams(repeatTests = 0))
4545
}
4646
}

test_runner/src/test/kotlin/ftl/args/IosArgsFileTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class IosArgsFileTest {
4848
)
4949
)
5050
assert(testShards, 1)
51-
assert(testRuns, 1)
51+
assert(repeatTests, 1)
5252
}
5353
}
5454

test_runner/src/test/kotlin/ftl/args/IosArgsTest.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class IosArgsTest {
3838
3939
flank:
4040
testShards: 7
41-
testRuns: 8
41+
repeatTests: 8
4242
test-targets-always-run:
4343
- a/testGrantPermissions
4444
test-targets:
@@ -84,7 +84,7 @@ class IosArgsTest {
8484

8585
// FlankYml
8686
assert(testShards, 7)
87-
assert(testRuns, 8)
87+
assert(repeatTests, 8)
8888
assert(testTargetsAlwaysRun, listOf("a/testGrantPermissions"))
8989

9090
// IosFlankYml
@@ -111,7 +111,7 @@ IosArgs
111111
112112
flank:
113113
testShards: 7
114-
testRuns: 8
114+
repeatTests: 8
115115
testTargetsAlwaysRun: [a/testGrantPermissions]
116116
# iOS flank
117117
testTargets: [b/testBasicSelection]
@@ -144,7 +144,7 @@ IosArgs
144144

145145
// FlankYml
146146
assert(testShards, 1)
147-
assert(testRuns, 1)
147+
assert(repeatTests, 1)
148148
assert(testTargetsAlwaysRun, emptyList<String>())
149149

150150
// IosFlankYml

test_runner/src/test/kotlin/ftl/doctor/DoctorTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ gcloud:
5050
5151
flank:
5252
testShards: 7
53-
testRuns: 8
53+
repeatTests: 8
5454
test-targets-always-run:
5555
- .
5656
three: .
@@ -98,7 +98,7 @@ gcloud:
9898
9999
flank:
100100
testShards: .
101-
testRuns: .
101+
repeatTests: .
102102
test-targets-always-run:
103103
- .
104104
test-targets:

test_runner/src/test/kotlin/ftl/fixtures/flank.gcs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ gcloud:
2727

2828
flank:
2929
testShards: 1
30-
testRuns: 1
30+
repeatTests: 1

test_runner/src/test/kotlin/ftl/fixtures/flank.ios.gcs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ flank:
1717
test-targets:
1818
- EarlGreyExampleMixedTests/testBasicSelection
1919
testShards: 1
20-
testRuns: 1
20+
repeatTests: 1

test_runner/src/test/kotlin/ftl/fixtures/flank.ios.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ flank:
1515
test-targets:
1616
- EarlGreyExampleMixedTests/testBasicSelection
1717
testShards: 1
18-
testRuns: 1
18+
repeatTests: 1

test_runner/src/test/kotlin/ftl/fixtures/flank.local.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ gcloud:
2727

2828
flank:
2929
testShards: 1
30-
testRuns: 1
30+
repeatTests: 1

test_runner/src/test/kotlin/ftl/fixtures/flank2.ios.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ gcloud:
1313

1414
flank:
1515
testShards: 2
16-
testRuns: 1
16+
repeatTests: 1
1717
test-targets:
1818
- EarlGreyExampleMixedTests/testGrantCameraPermission
1919
- EarlGreyExampleMixedTests/testGrantMicrophonePermission

test_runner/src/test/kotlin/ftl/run/GenericTestRunnerTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import org.mockito.Mockito.mock
99

1010
class GenericTestRunnerTest {
1111

12-
private fun createMock(testRuns: Int, testShardChunks: List<List<String>>): IArgs {
12+
private fun createMock(repeatTests: Int, testShardChunks: List<List<String>>): IArgs {
1313
val args = mock(IArgs::class.java)
14-
`when`(args.testRuns).thenReturn(testRuns)
14+
`when`(args.repeatTests).thenReturn(repeatTests)
1515
`when`(args.testShardChunks).thenReturn(testShardChunks)
1616
return args
1717
}

0 commit comments

Comments
 (0)