diff --git a/release_notes.md b/release_notes.md index 3798d8447e..35ee86be6f 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,9 @@ ## next (unreleased) +## v6.2.2 + +- [#566](https://github.com/TestArmada/flank/pull/566) Fix `--test` & `--xctestrun-file` on iOS CLI. ([bootstraponline](https://github.com/bootstraponline)) + ## v6.2.1 - [#563](https://github.com/TestArmada/flank/pull/563) Fix CLI support for iOS. ([bootstraponline](https://github.com/bootstraponline)) diff --git a/test_runner/src/main/kotlin/ftl/args/IosArgs.kt b/test_runner/src/main/kotlin/ftl/args/IosArgs.kt index b4f86c62df..977343c707 100644 --- a/test_runner/src/main/kotlin/ftl/args/IosArgs.kt +++ b/test_runner/src/main/kotlin/ftl/args/IosArgs.kt @@ -20,6 +20,7 @@ import ftl.config.FtlConstants import ftl.ios.IosCatalog import ftl.ios.Xctestrun import ftl.util.Utils +import ftl.util.Utils.fatalError import java.nio.file.Files import java.nio.file.Path @@ -42,8 +43,8 @@ class IosArgs( override val flakyTestAttempts = cli?.flakyTestAttempts ?: gcloud.flakyTestAttempts private val iosGcloud = iosGcloudYml.gcloud - var xctestrunZip = cli?.test ?: iosGcloud.test - var xctestrunFile = cli?.xctestrunFile ?: iosGcloud.xctestrunFile + var xctestrunZip = cli?.test ?: iosGcloud.test ?: fatalError("test is not set") + var xctestrunFile = cli?.xctestrunFile ?: iosGcloud.xctestrunFile ?: fatalError("xctestrun-file is not set") val xcodeVersion = cli?.xcodeVersion ?: iosGcloud.xcodeVersion val devices = cli?.device ?: iosGcloud.device diff --git a/test_runner/src/main/kotlin/ftl/args/yml/IosGcloudYml.kt b/test_runner/src/main/kotlin/ftl/args/yml/IosGcloudYml.kt index de187ceefc..323c34c05a 100644 --- a/test_runner/src/main/kotlin/ftl/args/yml/IosGcloudYml.kt +++ b/test_runner/src/main/kotlin/ftl/args/yml/IosGcloudYml.kt @@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import ftl.config.Device import ftl.config.FtlConstants.defaultIosModel import ftl.config.FtlConstants.defaultIosVersion -import ftl.util.Utils.assertNotEmpty /** * iOS specific gcloud parameters @@ -15,10 +14,10 @@ import ftl.util.Utils.assertNotEmpty */ @JsonIgnoreProperties(ignoreUnknown = true) class IosGcloudYmlParams( - val test: String = "", + val test: String? = null, @field:JsonProperty("xctestrun-file") - val xctestrunFile: String = "", + val xctestrunFile: String? = null, @field:JsonProperty("xcode-version") val xcodeVersion: String? = null, @@ -28,11 +27,6 @@ class IosGcloudYmlParams( companion object : IYmlKeys { override val keys = listOf("test", "xctestrun-file", "xcode-version", "device") } - - init { - assertNotEmpty(test, "test is not set") - assertNotEmpty(xctestrunFile, "xctestrun-file is not set") - } } @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/test_runner/src/main/kotlin/ftl/util/Utils.kt b/test_runner/src/main/kotlin/ftl/util/Utils.kt index eddf20c556..a1d702806b 100644 --- a/test_runner/src/main/kotlin/ftl/util/Utils.kt +++ b/test_runner/src/main/kotlin/ftl/util/Utils.kt @@ -45,7 +45,7 @@ object Utils { } @Suppress("NOTHING_TO_INLINE") - inline fun fatalError(e: String) { + inline fun fatalError(e: String): String { if (FtlConstants.useMock) { throw RuntimeException(e) }