Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-goral authored and mergify-bot committed Sep 1, 2020
1 parent c14816a commit 4421820
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion test_runner/src/main/kotlin/ftl/args/ValidateIosArgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import ftl.run.exception.FlankConfigurationError
import ftl.run.exception.IncompatibleTestDimensionError

fun IosArgs.validate() = apply {
validateRefresh()
commonArgs.validate()
assertXcodeSupported()
assertDevicesSupported()
assertTestTypes()
assertMaxTestShards()
assertTestFiles()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ftl.cli.firebase.test.android

import ftl.args.AndroidArgs
import ftl.args.validate
import ftl.cli.firebase.test.CommonRunCommand
import ftl.config.FtlConstants
import ftl.config.emptyAndroidConfig
Expand Down Expand Up @@ -43,7 +44,7 @@ class AndroidRunCommand : CommonRunCommand(), Runnable {
MockServer.start()
}

val config = AndroidArgs.load(Paths.get(configPath), cli = this)
val config = AndroidArgs.load(Paths.get(configPath), cli = this).validate()
runBlocking {
if (dumpShards) dumpShards(args = config, obfuscatedOutput = obfuscate)
else newTestRun(config)
Expand Down
3 changes: 2 additions & 1 deletion test_runner/src/main/kotlin/ftl/run/common/GetLastArgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ftl.run.common
import ftl.args.AndroidArgs
import ftl.args.IArgs
import ftl.args.IosArgs
import ftl.args.validate
import ftl.args.validateRefresh
import ftl.config.FtlConstants
import ftl.run.exception.FlankGeneralError
Expand All @@ -17,7 +18,7 @@ internal fun getLastArgs(args: IArgs): IArgs {

return when {
iosConfig.toFile().exists() -> IosArgs.load(iosConfig).validateRefresh()
androidConfig.toFile().exists() -> AndroidArgs.load(androidConfig)
androidConfig.toFile().exists() -> AndroidArgs.load(androidConfig).validate()
else -> throw FlankGeneralError("No config file found in the last run folder: $lastRun")
}
}

0 comments on commit 4421820

Please sign in to comment.