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

fix: Bad validation of local-result-dir by Doctor #1066

Merged
merged 1 commit into from
Aug 28, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ data class CommonFlankConfig @JsonIgnore constructor(
"keep-file-path",
"output-style",
"disable-results-upload",
"full-junit-result"
"full-junit-result",
"local-result-dir"
)

const val defaultLocalResultsDir = "results"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import com.google.common.truth.Truth.assertThat
import ftl.cli.firebase.test.INVALID_YML_PATH
import ftl.cli.firebase.test.SUCCESS_VALIDATION_MESSAGE
import ftl.config.FtlConstants
import ftl.run.exception.YmlValidationError
import ftl.test.util.FlankTestRunner
import ftl.test.util.TestHelper.normalizeLineEnding
import ftl.run.exception.YmlValidationError
import org.junit.Rule
import org.junit.Test
import org.junit.contrib.java.lang.system.SystemOutRule
Expand Down Expand Up @@ -76,4 +76,11 @@ class AndroidDoctorCommandTest {
run()
}
}

@Test
fun `android doctor should not fail on local-result-dir`() {
AndroidDoctorCommand().apply {
configPath = "./src/test/kotlin/ftl/fixtures/test_app_cases/flank-with_local_result_dir.yml"
}.run()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package ftl.cli.firebase.test.ios
import com.google.common.truth.Truth.assertThat
import ftl.cli.firebase.test.INVALID_YML_PATH
import ftl.cli.firebase.test.SUCCESS_VALIDATION_MESSAGE
import ftl.cli.firebase.test.android.AndroidDoctorCommand
import ftl.config.FtlConstants
import ftl.test.util.FlankTestRunner
import ftl.test.util.TestHelper.normalizeLineEnding
Expand Down Expand Up @@ -71,9 +70,16 @@ class IosDoctorCommandTest {

@Test(expected = YmlValidationError::class)
fun `should terminate with exit code 1 when yml validation fails`() {
AndroidDoctorCommand().run {
IosDoctorCommand().run {
configPath = INVALID_YML_PATH
run()
}
}

@Test
fun `ios doctor should not fail on local-result-dir`() {
IosDoctorCommand().apply {
configPath = FtlConstants.defaultIosConfig
}.run()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gcloud:
app: ./src/test/kotlin/ftl/fixtures/tmp/apk/app-debug.apk
test: ./src/test/kotlin/ftl/fixtures/tmp/apk/app-single-success-debug-androidTest.apk
results-dir: test_dir_2
flank:
local-result-dir: flank