Skip to content

Commit 83551ad

Browse files
Always find all iOS tests. Fail early on invalid iOS test (#462)
1 parent c2f1052 commit 83551ad

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

test_runner/src/main/kotlin/ftl/ios/Xctestrun.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,10 @@ object Xctestrun {
2626
val binaryRoot = productString.replace("__TESTROOT__/", testRoot)
2727
println("Found xctest: $binaryRoot")
2828

29-
val isSwift = Paths.get(binaryRoot, "libswiftRemoteMirror.dylib").toFile().exists()
3029
val binaryName = File(binaryRoot).nameWithoutExtension
3130
val binaryPath = Paths.get(binaryRoot, binaryName).toString()
3231

33-
val tests = if (isSwift) {
34-
(Parse.parseObjcTests(binaryPath) + Parse.parseSwiftTests(binaryPath)).distinct()
35-
} else {
36-
Parse.parseObjcTests(binaryPath)
37-
}
32+
val tests = (Parse.parseObjcTests(binaryPath) + Parse.parseSwiftTests(binaryPath)).distinct()
3833

3934
return tests.minus(skipTests)
4035
}

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ object IosTestRunner {
2323
suspend fun runTests(iosArgs: IosArgs): MatrixMap = coroutineScope {
2424
val (stopwatch, runGcsPath) = GenericTestRunner.beforeRunTests(iosArgs)
2525

26-
val xcTestGcsPath = if (iosArgs.xctestrunZip.startsWith(FtlConstants.GCS_PREFIX)) {
27-
iosArgs.xctestrunZip
28-
} else {
29-
GcStorage.uploadXCTestZip(iosArgs, runGcsPath)
30-
}
31-
3226
val iosDeviceList = GcIosMatrix.build(iosArgs.devices)
3327

3428
val xcTestParsed = Xctestrun.parse(iosArgs.xctestrunFile)
@@ -39,6 +33,13 @@ object IosTestRunner {
3933
val shardCounter = ShardCounter()
4034
val history = GcToolResults.createToolResultsHistory(iosArgs)
4135

36+
// Upload only after parsing shards to detect missing methods early.
37+
val xcTestGcsPath = if (iosArgs.xctestrunZip.startsWith(FtlConstants.GCS_PREFIX)) {
38+
iosArgs.xctestrunZip
39+
} else {
40+
GcStorage.uploadXCTestZip(iosArgs, runGcsPath)
41+
}
42+
4243
println(beforeRunMessage(iosArgs))
4344
repeat(runCount) {
4445
repeat(shardCount) { testShardsIndex ->

0 commit comments

Comments
 (0)