Skip to content

Commit

Permalink
Fix --test & --xctestrun-file on iOS CLI (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
bootstraponline authored Jun 19, 2019
1 parent b63fc7f commit 6844b48
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
4 changes: 4 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
5 changes: 3 additions & 2 deletions test_runner/src/main/kotlin/ftl/args/IosArgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
10 changes: 2 additions & 8 deletions test_runner/src/main/kotlin/ftl/args/yml/IosGcloudYml.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test_runner/src/main/kotlin/ftl/util/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 6844b48

Please sign in to comment.