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

Rename flaky-test-attempts to num-flaky-test-attempts #595

Merged
merged 2 commits into from
Aug 29, 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
2 changes: 1 addition & 1 deletion test_runner/flank.ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gcloud:
## Experimental!
## The number of times a TestExecution should be re-attempted if one or more\nof its test cases fail for any reason.
## The maximum number of reruns allowed is 10. Default is 0, which implies no reruns.
# flaky-test-attempts: 0
# num-flaky-test-attempts: 0

# -- IosGcloudYml --

Expand Down
2 changes: 1 addition & 1 deletion test_runner/flank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gcloud:
## Experimental!
## The number of times a TestExecution should be re-attempted if one or more\nof its test cases fail for any reason.
## The maximum number of reruns allowed is 10. Default is 0, which implies no reruns.
# flaky-test-attempts: 0
# num-flaky-test-attempts: 0

# -- AndroidGcloudYml --

Expand Down
2 changes: 1 addition & 1 deletion test_runner/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
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 @@ -133,7 +133,7 @@ ${listToString(directoriesToPull)}
${listToString(testTargets)}
device:
${devicesToString(devices)}
flaky-test-attempts: $flakyTestAttempts
num-flaky-test-attempts: $flakyTestAttempts

flank:
max-test-shards: $maxTestShards
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 @@ -122,7 +122,7 @@ IosArgs
xcode-version: $xcodeVersion
device:
${devicesToString(devices)}
flaky-test-attempts: $flakyTestAttempts
num-flaky-test-attempts: $flakyTestAttempts

flank:
max-test-shards: $maxTestShards
Expand Down
4 changes: 2 additions & 2 deletions test_runner/src/main/kotlin/ftl/args/yml/GcloudYml.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class GcloudYmlParams(
@field:JsonProperty("results-history-name")
val resultsHistoryName: String? = null,

@field:JsonProperty("flaky-test-attempts")
@field:JsonProperty("num-flaky-test-attempts")
val flakyTestAttempts: Int = 0
) {
companion object : IYmlKeys {
override val keys =
listOf("results-bucket", "results-dir", "record-video", "timeout", "async",
"results-history-name", "flaky-test-attempts")
"results-history-name", "num-flaky-test-attempts")
}
}

Expand Down
5 changes: 5 additions & 0 deletions test_runner/src/main/kotlin/ftl/args/yml/YamlDeprecated.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ object YamlDeprecated {
)

private val transforms = listOf(
ModifiedKey(
Key(Parent.gcloud, "flaky-test-attempts"),
Key(Parent.gcloud, "num-flaky-test-attempts"),
Level.Warning
),
// flank: testShards -> flank: maxTestShards
ModifiedKey(
Key(Parent.flank, "testShards"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class AndroidRunCommand : Runnable {
var resultsHistoryName: String? = null

@Option(
names = ["--flaky-test-attempts"],
names = ["--num-flaky-test-attempts"],
description = ["The number of times a TestExecution should be re-attempted if one or more of its test cases " +
"fail for any reason. The maximum number of reruns allowed is 10. Default is 0, which implies no reruns."]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class IosRunCommand : Runnable {
var resultsHistoryName: String? = null

@Option(
names = ["--flaky-test-attempts"],
names = ["--num-flaky-test-attempts"],
description = ["The number of times a TestExecution should be re-attempted if one or more of its test cases " +
"fail for any reason. The maximum number of reruns allowed is 10. Default is 0, which implies no reruns."]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ftl.reports.util
import ftl.reports.xml.model.JUnitTestCase
import ftl.reports.xml.model.JUnitTestResult

// Read in JUnitReport.xml and remove duplicate results when `flaky-test-attempts` is > 0
// Read in JUnitReport.xml and remove duplicate results when `num-flaky-test-attempts` is > 0
// for each test `name="testFails" classname="com.example.app.ExampleUiTest"`
// Keep first result. If next result for the same test is successful, keep last successful result.
object JUnitDedupe {
Expand Down
2 changes: 1 addition & 1 deletion test_runner/src/main/kotlin/ftl/run/RunningDevices.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RunningDevice(private val stopwatch: StopWatch, val id: String) {
progress = details.progressMessages ?: progress
}

// flaky-test-attempts restarts progress array at size 1
// num-flaky-test-attempts restarts progress array at size 1
if (lastProgressLen > progress.size) {
lastProgressLen = 0
}
Expand Down
6 changes: 3 additions & 3 deletions test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class AndroidArgsTest {
version: 24
locale: en
orientation: portrait
flaky-test-attempts: 3
num-flaky-test-attempts: 3

flank:
max-test-shards: 7
Expand Down Expand Up @@ -231,7 +231,7 @@ AndroidArgs
version: 24
locale: en
orientation: portrait
flaky-test-attempts: 3
num-flaky-test-attempts: 3

flank:
max-test-shards: 7
Expand Down Expand Up @@ -829,7 +829,7 @@ AndroidArgs
@Test
fun `cli flakyTestAttempts`() {
val cli = AndroidRunCommand()
CommandLine(cli).parseArgs("--flaky-test-attempts=3")
CommandLine(cli).parseArgs("--num-flaky-test-attempts=3")

val yaml = """
gcloud:
Expand Down
6 changes: 3 additions & 3 deletions test_runner/src/test/kotlin/ftl/args/IosArgsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class IosArgsTest {
version: 11.2
locale: c
orientation: d
flaky-test-attempts: 4
num-flaky-test-attempts: 4

flank:
max-test-shards: 7
Expand Down Expand Up @@ -177,7 +177,7 @@ IosArgs
version: 11.2
locale: c
orientation: d
flaky-test-attempts: 4
num-flaky-test-attempts: 4

flank:
max-test-shards: 7
Expand Down Expand Up @@ -623,7 +623,7 @@ IosArgs
@Test
fun `cli flakyTestAttempts`() {
val cli = IosRunCommand()
CommandLine(cli).parseArgs("--flaky-test-attempts=3")
CommandLine(cli).parseArgs("--num-flaky-test-attempts=3")

val yaml = """
gcloud:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ class YamlDeprecatedTest {
}

@Test
fun `Flank old keys renamed to new keys`() {
fun `Old keys renamed to new keys`() {
val input = """
---
gcloud:
project: 0
flaky-test-attempts: 1

flank:
testShards: 1
Expand All @@ -90,7 +91,8 @@ class YamlDeprecatedTest {

val expected = """
---
gcloud: {}
gcloud:
num-flaky-test-attempts: 1
flank:
project: 0
max-test-shards: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class AndroidRunCommandTest {
@Test
fun `flakyTestAttempts parse`() {
val cmd = AndroidRunCommand()
CommandLine(cmd).parseArgs("--flaky-test-attempts=10")
CommandLine(cmd).parseArgs("--num-flaky-test-attempts=10")

assertThat(cmd.flakyTestAttempts).isEqualTo(10)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class IosRunCommandTest {
@Test
fun `flakyTestAttempts parse`() {
val cmd = IosRunCommand()
CommandLine(cmd).parseArgs("--flaky-test-attempts=10")
CommandLine(cmd).parseArgs("--num-flaky-test-attempts=10")

assertThat(cmd.flakyTestAttempts).isEqualTo(10)
}
Expand Down