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

Add --async #416

Merged
merged 1 commit into from
Dec 3, 2018
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
2 changes: 1 addition & 1 deletion test_runner/src/main/kotlin/ftl/args/AndroidArgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class AndroidArgs(
override val resultsBucket: String
override val recordVideo = cli?.recordVideo ?: cli?.noRecordVideo?.not() ?: gcloud.recordVideo
override val testTimeout = cli?.timeout ?: gcloud.timeout
override val async = gcloud.async
override val async = cli?.async ?: gcloud.async
override val projectId = gcloud.project
override val resultsHistoryName = gcloud.resultsHistoryName

Expand Down
2 changes: 1 addition & 1 deletion test_runner/src/main/kotlin/ftl/args/IosArgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class IosArgs(
override val resultsBucket: String
override val recordVideo = cli?.recordVideo ?: cli?.noRecordVideo?.not() ?: gcloud.recordVideo
override val testTimeout = cli?.timeout ?: gcloud.timeout
override val async = gcloud.async
override val async = cli?.async ?: gcloud.async
override val projectId = gcloud.project
override val resultsHistoryName = gcloud.resultsHistoryName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,7 @@ class AndroidRunCommand : Runnable {
|possible testing time is 30m on physical devices and 60m on virtual devices. The TIMEOUT units can be h, m,
| or s. If no unit is given, seconds are assumed. """])
var timeout: String? = null

@Option(names = ["--async"], description = ["""Invoke a test asynchronously without waiting for test results."""])
var async: Boolean? = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ class IosRunCommand : Runnable {
|possible testing time is 30m on physical devices and 60m on virtual devices. The TIMEOUT units can be h, m,
| or s. If no unit is given, seconds are assumed. """])
var timeout: String? = null

@Option(names = ["--async"], description = ["""Invoke a test asynchronously without waiting for test results."""])
var async: Boolean? = null
}
15 changes: 15 additions & 0 deletions test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -576,4 +576,19 @@ AndroidArgs
assertThat(AndroidArgs.load(yaml).testTimeout).isEqualTo("2m")
assertThat(AndroidArgs.load(yaml, cli).testTimeout).isEqualTo("1m")
}

@Test
fun cli_async() {
val cli = AndroidRunCommand()
CommandLine(cli).parse("--async")

val yaml = """
gcloud:
app: $appApk
test: $testApk
async: false
"""
assertThat(AndroidArgs.load(yaml).async).isEqualTo(false)
assertThat(AndroidArgs.load(yaml, cli).async).isEqualTo(true)
}
}
15 changes: 15 additions & 0 deletions test_runner/src/test/kotlin/ftl/args/IosArgsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,19 @@ IosArgs
assertThat(IosArgs.load(yaml).testTimeout).isEqualTo("2m")
assertThat(IosArgs.load(yaml, cli).testTimeout).isEqualTo("1m")
}

@Test
fun cli_async() {
val cli = IosRunCommand()
CommandLine(cli).parse("--async")

val yaml = """
gcloud:
test: $testPath
xctestrun-file: $xctestrunFile
async: false
"""
assertThat(IosArgs.load(yaml).async).isEqualTo(false)
assertThat(IosArgs.load(yaml, cli).async).isEqualTo(true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class AndroidRunCommandTest {
assertThat(cmd.recordVideo).isNull()
assertThat(cmd.noRecordVideo).isNull()
assertThat(cmd.timeout).isNull()
assertThat(cmd.async).isNull()
}

@Test
Expand Down Expand Up @@ -208,4 +209,12 @@ class AndroidRunCommandTest {

assertThat(cmd.timeout).isEqualTo("1m")
}

@Test
fun async_parse() {
val cmd = AndroidRunCommand()
CommandLine(cmd).parse("--async")

assertThat(cmd.async).isTrue()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class IosRunCommandTest {
assertThat(cmd.recordVideo).isNull()
assertThat(cmd.noRecordVideo).isNull()
assertThat(cmd.timeout).isNull()
assertThat(cmd.async).isNull()
}

@Test
Expand Down Expand Up @@ -94,4 +95,12 @@ class IosRunCommandTest {

assertThat(cmd.timeout).isEqualTo("1m")
}

@Test
fun async_parse() {
val cmd = IosRunCommand()
CommandLine(cmd).parse("--async")

assertThat(cmd.async).isTrue()
}
}