Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always find all iOS tests. Fail early on invalid iOS test #462

Merged
merged 1 commit into from
Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions test_runner/src/main/kotlin/ftl/ios/Xctestrun.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
13 changes: 7 additions & 6 deletions test_runner/src/main/kotlin/ftl/run/IosTestRunner.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 ->
Expand Down