From 025df93dc0f2ff4ac66dd017853459e889ebdad7 Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Wed, 16 Jan 2019 18:00:33 -0500 Subject: [PATCH] Always find all iOS tests. Fail early on invalid iOS test --- test_runner/src/main/kotlin/ftl/ios/Xctestrun.kt | 7 +------ .../src/main/kotlin/ftl/run/IosTestRunner.kt | 13 +++++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/test_runner/src/main/kotlin/ftl/ios/Xctestrun.kt b/test_runner/src/main/kotlin/ftl/ios/Xctestrun.kt index c38709b45d..5b3a34672f 100644 --- a/test_runner/src/main/kotlin/ftl/ios/Xctestrun.kt +++ b/test_runner/src/main/kotlin/ftl/ios/Xctestrun.kt @@ -26,15 +26,10 @@ object Xctestrun { val binaryRoot = productString.replace("__TESTROOT__/", testRoot) println("Found xctest: $binaryRoot") - val isSwift = Paths.get(binaryRoot, "libswiftRemoteMirror.dylib").toFile().exists() val binaryName = File(binaryRoot).nameWithoutExtension val binaryPath = Paths.get(binaryRoot, binaryName).toString() - val tests = if (isSwift) { - (Parse.parseObjcTests(binaryPath) + Parse.parseSwiftTests(binaryPath)).distinct() - } else { - Parse.parseObjcTests(binaryPath) - } + val tests = (Parse.parseObjcTests(binaryPath) + Parse.parseSwiftTests(binaryPath)).distinct() return tests.minus(skipTests) } diff --git a/test_runner/src/main/kotlin/ftl/run/IosTestRunner.kt b/test_runner/src/main/kotlin/ftl/run/IosTestRunner.kt index 250071e41c..383d79d89d 100644 --- a/test_runner/src/main/kotlin/ftl/run/IosTestRunner.kt +++ b/test_runner/src/main/kotlin/ftl/run/IosTestRunner.kt @@ -23,12 +23,6 @@ object IosTestRunner { suspend fun runTests(iosArgs: IosArgs): MatrixMap = coroutineScope { val (stopwatch, runGcsPath) = GenericTestRunner.beforeRunTests(iosArgs) - val xcTestGcsPath = if (iosArgs.xctestrunZip.startsWith(FtlConstants.GCS_PREFIX)) { - iosArgs.xctestrunZip - } else { - GcStorage.uploadXCTestZip(iosArgs, runGcsPath) - } - val iosDeviceList = GcIosMatrix.build(iosArgs.devices) val xcTestParsed = Xctestrun.parse(iosArgs.xctestrunFile) @@ -39,6 +33,13 @@ object IosTestRunner { val shardCounter = ShardCounter() val history = GcToolResults.createToolResultsHistory(iosArgs) + // Upload only after parsing shards to detect missing methods early. + val xcTestGcsPath = if (iosArgs.xctestrunZip.startsWith(FtlConstants.GCS_PREFIX)) { + iosArgs.xctestrunZip + } else { + GcStorage.uploadXCTestZip(iosArgs, runGcsPath) + } + println(beforeRunMessage(iosArgs)) repeat(runCount) { repeat(shardCount) { testShardsIndex ->