From aa5b3682daaf3cb0f9c1c3ac4b6da6cb782ed35d Mon Sep 17 00:00:00 2001 From: Eli Hart Date: Fri, 5 Apr 2019 09:05:01 -0500 Subject: [PATCH] Change name and description of flag --- README.md | 14 ++++++-------- release_notes.md | 2 +- test_runner/flank.ios.yml | 7 +++---- test_runner/flank.yml | 7 +++---- .../src/main/kotlin/ftl/args/AndroidArgs.kt | 4 ++-- test_runner/src/main/kotlin/ftl/args/IArgs.kt | 2 +- test_runner/src/main/kotlin/ftl/args/IosArgs.kt | 4 ++-- .../src/main/kotlin/ftl/args/yml/FlankYml.kt | 6 +++--- .../cli/firebase/test/android/AndroidRunCommand.kt | 6 +++--- .../ftl/cli/firebase/test/ios/IosRunCommand.kt | 6 +++--- test_runner/src/main/kotlin/ftl/gc/GcStorage.kt | 2 +- .../src/test/kotlin/ftl/args/AndroidArgsTest.kt | 12 ++++++------ .../src/test/kotlin/ftl/args/IosArgsTest.kt | 10 +++++----- .../firebase/test/android/AndroidRunCommandTest.kt | 8 ++++---- .../ftl/cli/firebase/test/ios/IosRunCommandTest.kt | 8 ++++---- 15 files changed, 47 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index b50c4f4986..bfe8cd12be 100644 --- a/README.md +++ b/README.md @@ -131,10 +131,9 @@ flank: ## Google cloud storage path to store the JUnit XML results from the last run. # smart-flank-gcs-path: gs://tmp_flank/flank/test_app_ios.xml - ## Whether the JUnit XML results should be uploaded for Smart Flank. - ## This can be disabled to prevent new results from overriding previous results. - ## Default: true - # smart-flank-upload-enabled: true + ## Disables smart flank JUnit XML uploading. Useful for preventing timing data from being updated. + ## Default: false + # smart-flank-disable-upload: false ## Disables sharding. Useful for parameterized tests. # disable-sharding: false @@ -279,10 +278,9 @@ flank: ## Google cloud storage path to store the JUnit XML results from the last run. # smart-flank-gcs-path: gs://tmp_flank/flank/test_app_android.xml - ## Whether the JUnit XML results should be uploaded for Smart Flank. - ## This can be disabled to prevent new results from overriding previous results. - ## Default: true - # smart-flank-upload-enabled: true + ## Disables smart flank JUnit XML uploading. Useful for preventing timing data from being updated. + ## Default: false + # smart-flank-disable-upload: false ## Disables sharding. Useful for parameterized tests. # disable-sharding: false diff --git a/release_notes.md b/release_notes.md index 1fa2769154..a02b5a3ad7 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,6 +1,6 @@ ## next (unreleased) -- [#537](https://github.com/TestArmada/flank/pull/537) Add `smart-flank-upload-enabled` yml option to prevent new results from overriding previous results. ([elihart](https://github.com/elihart)) +- [#537](https://github.com/TestArmada/flank/pull/537) Add `smart-flank-disable-upload` yml option to prevent new results from overriding previous results. ([elihart](https://github.com/elihart)) ## v5.0.1 diff --git a/test_runner/flank.ios.yml b/test_runner/flank.ios.yml index 0d9753679a..13da74843b 100644 --- a/test_runner/flank.ios.yml +++ b/test_runner/flank.ios.yml @@ -82,10 +82,9 @@ flank: ## Google cloud storage path to store the JUnit XML results from the last run. # smart-flank-gcs-path: gs://tmp_flank/flank/test_app_ios.xml - ## Whether the JUnit XML results should be uploaded for Smart Flank. - ## This can be disabled to prevent new results from overriding previous results. - ## Default: true - # smart-flank-upload-enabled: true + ## Disables smart flank JUnit XML uploading. Useful for preventing timing data from being updated. + ## Default: false + # smart-flank-disable-upload: false ## Disables sharding. Useful for parameterized tests. # disable-sharding: false diff --git a/test_runner/flank.yml b/test_runner/flank.yml index 7ec33f832b..69fdd4f06c 100644 --- a/test_runner/flank.yml +++ b/test_runner/flank.yml @@ -107,10 +107,9 @@ flank: ## Google cloud storage path to store the JUnit XML results from the last run. # smart-flank-gcs-path: gs://tmp_flank/flank/test_app_android.xml - ## Whether the JUnit XML results should be uploaded for Smart Flank. - ## This can be disabled to prevent new results from overriding previous results. - ## Default: true - # smart-flank-upload-enabled: true + ## Disables smart flank JUnit XML uploading. Useful for preventing timing data from being updated. + ## Default: false + # smart-flank-disable-upload: false ## Disables sharding. Useful for parameterized tests. # disable-sharding: false diff --git a/test_runner/src/main/kotlin/ftl/args/AndroidArgs.kt b/test_runner/src/main/kotlin/ftl/args/AndroidArgs.kt index 6d2d3dfce1..cd8b133249 100644 --- a/test_runner/src/main/kotlin/ftl/args/AndroidArgs.kt +++ b/test_runner/src/main/kotlin/ftl/args/AndroidArgs.kt @@ -69,7 +69,7 @@ class AndroidArgs( override val shardTime = cli?.shardTime ?: flank.shardTime override val repeatTests = cli?.repeatTests ?: flank.repeatTests override val smartFlankGcsPath = flank.smartFlankGcsPath - override val smartFlankUploadEnabled = cli?.smartFlankUploadEnabled ?: flank.smartFlankUploadEnabled + override val smartFlankDisableUpload = cli?.smartFlankDisableUpload ?: flank.smartFlankDisableUpload override val testTargetsAlwaysRun = cli?.testTargetsAlwaysRun ?: flank.testTargetsAlwaysRun override val filesToDownload = cli?.filesToDownload ?: flank.filesToDownload override val disableSharding = cli?.disableSharding ?: flank.disableSharding @@ -170,7 +170,7 @@ ${devicesToString(devices)} shard-time: $shardTime repeat-tests: $repeatTests smart-flank-gcs-path: $smartFlankGcsPath - smart-flank-upload-enabled: $smartFlankUploadEnabled + smart-flank-disable-upload: $smartFlankDisableUpload files-to-download: ${listToString(filesToDownload)} test-targets-always-run: diff --git a/test_runner/src/main/kotlin/ftl/args/IArgs.kt b/test_runner/src/main/kotlin/ftl/args/IArgs.kt index b2d0f89f61..6d83ea22b6 100644 --- a/test_runner/src/main/kotlin/ftl/args/IArgs.kt +++ b/test_runner/src/main/kotlin/ftl/args/IArgs.kt @@ -21,7 +21,7 @@ interface IArgs { val shardTime: Int val repeatTests: Int val smartFlankGcsPath: String - val smartFlankUploadEnabled: Boolean + val smartFlankDisableUpload: Boolean val testTargetsAlwaysRun: List val filesToDownload: List val disableSharding: Boolean diff --git a/test_runner/src/main/kotlin/ftl/args/IosArgs.kt b/test_runner/src/main/kotlin/ftl/args/IosArgs.kt index 0a48ee9d64..615615bb0f 100644 --- a/test_runner/src/main/kotlin/ftl/args/IosArgs.kt +++ b/test_runner/src/main/kotlin/ftl/args/IosArgs.kt @@ -52,7 +52,7 @@ class IosArgs( override val shardTime = cli?.shardTime ?: flank.shardTime override val repeatTests = cli?.repeatTests ?: flank.repeatTests override val smartFlankGcsPath = flank.smartFlankGcsPath - override val smartFlankUploadEnabled = cli?.smartFlankUploadEnabled ?: flank.smartFlankUploadEnabled + override val smartFlankDisableUpload = cli?.smartFlankDisableUpload ?: flank.smartFlankDisableUpload override val testTargetsAlwaysRun = cli?.testTargetsAlwaysRun ?: flank.testTargetsAlwaysRun override val filesToDownload = cli?.filesToDownload ?: flank.filesToDownload override val disableSharding = cli?.disableSharding ?: flank.disableSharding @@ -125,7 +125,7 @@ ${devicesToString(devices)} shard-time: $shardTime repeat-tests: $repeatTests smart-flank-gcs-path: $smartFlankGcsPath - smart-flank-upload-enabled: $smartFlankUploadEnabled + smart-flank-disable-upload: $smartFlankDisableUpload test-targets-always-run: ${listToString(testTargetsAlwaysRun)} files-to-download: diff --git a/test_runner/src/main/kotlin/ftl/args/yml/FlankYml.kt b/test_runner/src/main/kotlin/ftl/args/yml/FlankYml.kt index c3a9d4c963..57814a4702 100644 --- a/test_runner/src/main/kotlin/ftl/args/yml/FlankYml.kt +++ b/test_runner/src/main/kotlin/ftl/args/yml/FlankYml.kt @@ -23,8 +23,8 @@ class FlankYmlParams( @field:JsonProperty("smart-flank-gcs-path") val smartFlankGcsPath: String = "", - @field:JsonProperty("smart-flank-upload-enabled") - val smartFlankUploadEnabled: Boolean = true, + @field:JsonProperty("smart-flank-disable-upload") + val smartFlankDisableUpload: Boolean = false, @field:JsonProperty("disable-sharding") val disableSharding: Boolean = false, @@ -42,7 +42,7 @@ class FlankYmlParams( ) { companion object : IYmlKeys { override val keys = listOf( - "max-test-shards", "shard-time", "repeat-tests", "smart-flank-gcs-path", "smart-flank-upload-enabled", + "max-test-shards", "shard-time", "repeat-tests", "smart-flank-gcs-path", "smart-flank-disable-upload", "disable-sharding", "test-targets-always-run", "files-to-download", "project", "local-result-dir" ) diff --git a/test_runner/src/main/kotlin/ftl/cli/firebase/test/android/AndroidRunCommand.kt b/test_runner/src/main/kotlin/ftl/cli/firebase/test/android/AndroidRunCommand.kt index 1334ae0a72..623f5ba044 100644 --- a/test_runner/src/main/kotlin/ftl/cli/firebase/test/android/AndroidRunCommand.kt +++ b/test_runner/src/main/kotlin/ftl/cli/firebase/test/android/AndroidRunCommand.kt @@ -281,8 +281,8 @@ class AndroidRunCommand : Runnable { var localResultDir: String? = null @Option( - names = ["--smart-flank-upload-enabled"], - description = ["Whether the JUnit XML results should be uploaded to the Smart Flank cloud storage."] + names = ["--smart-flank-disable-upload"], + description = ["Disables smart flank JUnit XML uploading. Useful for preventing timing data from being updated."] ) - var smartFlankUploadEnabled: Boolean? = null + var smartFlankDisableUpload: Boolean? = null } diff --git a/test_runner/src/main/kotlin/ftl/cli/firebase/test/ios/IosRunCommand.kt b/test_runner/src/main/kotlin/ftl/cli/firebase/test/ios/IosRunCommand.kt index 1ddc565c2c..1217a009f9 100644 --- a/test_runner/src/main/kotlin/ftl/cli/firebase/test/ios/IosRunCommand.kt +++ b/test_runner/src/main/kotlin/ftl/cli/firebase/test/ios/IosRunCommand.kt @@ -222,8 +222,8 @@ class IosRunCommand : Runnable { var localResultsDir: String? = null @Option( - names = ["--smart-flank-upload-enabled"], - description = ["Whether the JUnit XML results should be uploaded to the Smart Flank cloud storage."] + names = ["--smart-flank-disable-upload"], + description = ["Disables smart flank JUnit XML uploading. Useful for preventing timing data from being updated."] ) - var smartFlankUploadEnabled: Boolean? = null + var smartFlankDisableUpload: Boolean? = null } diff --git a/test_runner/src/main/kotlin/ftl/gc/GcStorage.kt b/test_runner/src/main/kotlin/ftl/gc/GcStorage.kt index b16ada204d..1c413e8029 100644 --- a/test_runner/src/main/kotlin/ftl/gc/GcStorage.kt +++ b/test_runner/src/main/kotlin/ftl/gc/GcStorage.kt @@ -54,7 +54,7 @@ object GcStorage { ) fun uploadJunitXml(testResult: JUnitTestResult, args: IArgs) { - if (args.smartFlankGcsPath.isEmpty() || !args.smartFlankUploadEnabled) return + if (args.smartFlankGcsPath.isEmpty() || !args.smartFlankDisableUpload) return // bucket/path/to/object val rawPath = args.smartFlankGcsPath.drop(GCS_PREFIX.length) diff --git a/test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt b/test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt index 6196927eeb..cc49fcfc26 100644 --- a/test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt +++ b/test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt @@ -218,7 +218,7 @@ AndroidArgs shard-time: 60 repeat-tests: 8 smart-flank-gcs-path:${' '} - smart-flank-upload-enabled: true + smart-flank-disable-upload: false files-to-download: - /sdcard/screenshots - /sdcard/screenshots2 @@ -816,20 +816,20 @@ AndroidArgs } @Test - fun `cli smart-flank-upload-enabled`() { + fun `cli smart-flank-disable-upload`() { val cli = AndroidRunCommand() - CommandLine(cli).parse("--smart-flank-upload-enabled=false") + CommandLine(cli).parse("--smart-flank-disable-upload=true") val yaml = """ gcloud: app: $appApk test: $testApk flank: - smart-flank-upload-enabled: true + smart-flank-disable-upload: false """ - assertThat(AndroidArgs.load(yaml).smartFlankUploadEnabled).isEqualTo(true) + assertThat(AndroidArgs.load(yaml).smartFlankDisableUpload).isEqualTo(false) val androidArgs = AndroidArgs.load(yaml, cli) - assertThat(androidArgs.smartFlankUploadEnabled).isEqualTo(false) + assertThat(androidArgs.smartFlankDisableUpload).isEqualTo(true) } } diff --git a/test_runner/src/test/kotlin/ftl/args/IosArgsTest.kt b/test_runner/src/test/kotlin/ftl/args/IosArgsTest.kt index a8c64b5686..a5fd397143 100644 --- a/test_runner/src/test/kotlin/ftl/args/IosArgsTest.kt +++ b/test_runner/src/test/kotlin/ftl/args/IosArgsTest.kt @@ -167,7 +167,7 @@ IosArgs shard-time: 60 repeat-tests: 8 smart-flank-gcs-path:${' '} - smart-flank-upload-enabled: true + smart-flank-disable-upload: false test-targets-always-run: - a/testGrantPermissions - a/testGrantPermissions2 @@ -636,19 +636,19 @@ IosArgs } @Test - fun `cli smart-flank-upload-enabled`() { + fun `cli smart-flank-disable-upload`() { val cli = IosRunCommand() - CommandLine(cli).parse("--smart-flank-upload-enabled=false") + CommandLine(cli).parse("--smart-flank-disable-upload=true") val yaml = """ gcloud: test: $testPath xctestrun-file: $testPath """ - assertThat(IosArgs.load(yaml).smartFlankUploadEnabled).isEqualTo(true) + assertThat(IosArgs.load(yaml).smartFlankDisableUpload).isEqualTo(false) val androidArgs = IosArgs.load(yaml, cli) - assertThat(androidArgs.smartFlankUploadEnabled).isEqualTo(false) + assertThat(androidArgs.smartFlankDisableUpload).isEqualTo(true) } private fun getValidTestsSample() = listOf( diff --git a/test_runner/src/test/kotlin/ftl/cli/firebase/test/android/AndroidRunCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/firebase/test/android/AndroidRunCommandTest.kt index 5f69a7716e..91f5849cce 100644 --- a/test_runner/src/test/kotlin/ftl/cli/firebase/test/android/AndroidRunCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/firebase/test/android/AndroidRunCommandTest.kt @@ -88,7 +88,7 @@ class AndroidRunCommandTest { assertThat(cmd.flakyTestAttempts).isNull() assertThat(cmd.disableSharding).isNull() assertThat(cmd.localResultDir).isNull() - assertThat(cmd.smartFlankUploadEnabled).isNull() + assertThat(cmd.smartFlankDisableUpload).isNull() } @Test @@ -323,10 +323,10 @@ class AndroidRunCommandTest { } @Test - fun `smartFlankUploadEnabled parse`() { + fun `smartFlankDisableUpload parse`() { val cmd = AndroidRunCommand() - CommandLine(cmd).parse("--smart-flank-upload-enabled=false") + CommandLine(cmd).parse("--smart-flank-disable-upload=true") - assertThat(cmd.smartFlankUploadEnabled).isEqualTo(false) + assertThat(cmd.smartFlankDisableUpload).isEqualTo(true) } } diff --git a/test_runner/src/test/kotlin/ftl/cli/firebase/test/ios/IosRunCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/firebase/test/ios/IosRunCommandTest.kt index 5e79c2125b..10ccb05f51 100644 --- a/test_runner/src/test/kotlin/ftl/cli/firebase/test/ios/IosRunCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/firebase/test/ios/IosRunCommandTest.kt @@ -82,7 +82,7 @@ class IosRunCommandTest { assertThat(cmd.resultsDir).isNull() assertThat(cmd.flakyTestAttempts).isNull() assertThat(cmd.localResultsDir).isNull() - assertThat(cmd.smartFlankUploadEnabled).isNull() + assertThat(cmd.smartFlankDisableUpload).isNull() } @Test @@ -258,10 +258,10 @@ class IosRunCommandTest { } @Test - fun `smart-flank-upload-enabled parse`() { + fun `smart-flank-disable-upload parse`() { val cmd = IosRunCommand() - CommandLine(cmd).parse("--smart-flank-upload-enabled=false") + CommandLine(cmd).parse("--smart-flank-disable-upload=true") - assertThat(cmd.smartFlankUploadEnabled).isEqualTo(false) + assertThat(cmd.smartFlankDisableUpload).isEqualTo(true) } }