Cannot round NaN value exception
Tried with v5.0.1 and v5.1.0.
I build iOS a project with Swift 5 and Xcode 10.2.0. In Flank config xcode-version: 10.1.
After updating the main project to the newest swift and Xcode Flank started showing the exception.
java -jar ./flank.jar firebase test ios run
Exception in thread "main" picocli.CommandLine$ExecutionException: Error while running command (ftl.cli.firebase.test.ios.IosRunCommand@6b52dd31): java.lang.IllegalArgumentException: Cannot round NaN value.
at picocli.CommandLine.execute(CommandLine.java:1168)
at picocli.CommandLine.access$800(CommandLine.java:141)
at picocli.CommandLine$RunLast.handle(CommandLine.java:1367)
at picocli.CommandLine$RunLast.handle(CommandLine.java:1335)
at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1243)
at picocli.CommandLine.parseWithHandlers(CommandLine.java:1526)
at picocli.CommandLine.run(CommandLine.java:1974)
at picocli.CommandLine.run(CommandLine.java:1920)
at ftl.Main$Companion.main(Main.kt:41)
at ftl.Main.main(Main.kt)
Caused by: java.lang.IllegalArgumentException: Cannot round NaN value.
at kotlin.math.MathKt__MathJVMKt.roundToInt(MathJVM.kt:602)
at ftl.shard.Shard.createShardsByShardCount(Shard.kt:126)
at ftl.args.ArgsHelper.calculateShards(ArgsHelper.kt:205)
at ftl.args.IosArgs$testShardChunks$2.invoke(IosArgs.kt:71)
at ftl.args.IosArgs$testShardChunks$2.invoke(IosArgs.kt:26)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at ftl.args.IosArgs.getTestShardChunks(IosArgs.kt)
at ftl.run.IosTestRunner$runTests$2.invokeSuspend(IosTestRunner.kt:33)
at ftl.run.IosTestRunner$runTests$2.invoke(IosTestRunner.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:186)
at ftl.run.IosTestRunner.runTests(IosTestRunner.kt:24)
at ftl.run.TestRunner.runTests(TestRunner.kt:53)
at ftl.run.TestRunner.newRun(TestRunner.kt:371)
at ftl.cli.firebase.test.ios.IosRunCommand$run$1.invokeSuspend(IosRunCommand.kt:32)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.kt:116)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:76)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:53)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:35)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at ftl.cli.firebase.test.ios.IosRunCommand.run(IosRunCommand.kt:31)
at picocli.CommandLine.execute(CommandLine.java:1160)
... 9 more
NaN crash is fixed on master. The root cause is related to the macOS system being detected as Linux, which then invokes swift-demangle without xcrun. That's invalid on macOS so we end up with a list of not demanged tests and that's parsed out to 0 tests.
https://github.com/TestArmada/flank/pull/547 will hopefully fix the issue.
Fixed by https://github.com/TestArmada/flank/pull/549
The issue was we really were running on Linux and the bundled Linux binaries were not yet updated to support Swift 5. That's fixed on master and will be in the next release.