From 06a85b3b5e01d517bbe354db8735b90fa09e696b Mon Sep 17 00:00:00 2001 From: piotradamczyk5 <65554637+piotradamczyk5@users.noreply.github.com> Date: Tue, 5 Jan 2021 10:21:52 +0100 Subject: [PATCH] fix: Fix problem with test-runner-class (#1453) Fixes #1444 `test-runner-class` has a default value (the last name extracted from the APK manifest), so it is not needed to fast fail if this option is not specified ## Test Plan > How do we know the code works? 1. Set `gcloud.type: instrumentation` to your `flank.yml`. 2. Run `flank run android` 3. Do not set `test-runner-class` 4. Tests do not fast fail ## Checklist - [x] Unit tested --- .../main/kotlin/ftl/args/ValidateAndroidArgs.kt | 1 - .../src/test/kotlin/ftl/args/AndroidArgsTest.kt | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/test_runner/src/main/kotlin/ftl/args/ValidateAndroidArgs.kt b/test_runner/src/main/kotlin/ftl/args/ValidateAndroidArgs.kt index 26083541b3..96fbb58c2b 100644 --- a/test_runner/src/main/kotlin/ftl/args/ValidateAndroidArgs.kt +++ b/test_runner/src/main/kotlin/ftl/args/ValidateAndroidArgs.kt @@ -84,7 +84,6 @@ private fun AndroidArgs.assertType() = type?.let { if (appApk == null) throw FlankGeneralError("A valid AppApk must be defined if Type parameter is used.") if (it == Type.INSTRUMENTATION) { if (testApk == null) throw FlankGeneralError("Instrumentation tests require a valid testApk defined.") - if (testRunnerClass == null) throw FlankGeneralError("Instrumentation tests require a valid test-runner-class defined.") } } diff --git a/test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt b/test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt index 65c1d2872a..c14560558a 100644 --- a/test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt +++ b/test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt @@ -1999,22 +1999,6 @@ AndroidArgs AndroidArgs.load(yaml).validate() } - @Test(expected = FlankGeneralError::class) - fun `should throw exception if correct type requested instrumental but no test runner set`() { - val yaml = """ - gcloud: - app: $appApk - test: $testApk - device: - - model: Nexus6 - version: 25 - locale: en - orientation: portrait - type: instrumentation - """.trimIndent() - AndroidArgs.load(yaml).validate() - } - @Test fun `should Not throw exception if correct type requested robo`() { val yaml = """