-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
742030d
commit 611e0f0
Showing
11 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
test_runner/src/main/kotlin/ftl/cli/firebase/test/android/AndroidTestEnvironmentCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package ftl.cli.firebase.test.android | ||
|
||
import ftl.android.AndroidCatalog.devicesCatalogAsTable | ||
import ftl.android.AndroidCatalog.supportedVersionsAsTable | ||
import ftl.args.AndroidArgs | ||
import ftl.config.FtlConstants | ||
import picocli.CommandLine | ||
import java.nio.file.Paths | ||
|
||
@CommandLine.Command( | ||
name = "test-environment", | ||
headerHeading = "", | ||
synopsisHeading = "%n", | ||
descriptionHeading = "%n@|bold,underline Description:|@%n%n", | ||
parameterListHeading = "%n@|bold,underline Parameters:|@%n", | ||
optionListHeading = "%n@|bold,underline Options:|@%n", | ||
header = ["Print available devices and OS versions list to test against"], | ||
description = ["Print available Android devices and Android OS versions list to test against"], | ||
usageHelpAutoWidth = true | ||
) | ||
class AndroidTestEnvironmentCommand : Runnable { | ||
override fun run() { | ||
println(devicesCatalogAsTable(AndroidArgs.load(Paths.get(configPath)).project)) | ||
println(supportedVersionsAsTable(AndroidArgs.load(Paths.get(configPath)).project)) | ||
} | ||
|
||
@CommandLine.Option(names = ["-c", "--config"], description = ["YAML config file path"]) | ||
var configPath: String = FtlConstants.defaultAndroidConfig | ||
|
||
@CommandLine.Option(names = ["-h", "--help"], usageHelp = true, description = ["Prints this help message"]) | ||
var usageHelpRequested: Boolean = false | ||
} |
32 changes: 32 additions & 0 deletions
32
test_runner/src/main/kotlin/ftl/cli/firebase/test/ios/IosTestEnvironmentCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package ftl.cli.firebase.test.ios | ||
|
||
import ftl.args.IosArgs | ||
import ftl.config.FtlConstants | ||
import ftl.ios.IosCatalog.devicesCatalogAsTable | ||
import ftl.ios.IosCatalog.softwareVersionsAsTable | ||
import picocli.CommandLine | ||
import java.nio.file.Paths | ||
|
||
@CommandLine.Command( | ||
name = "test-environment", | ||
headerHeading = "", | ||
synopsisHeading = "%n", | ||
descriptionHeading = "%n@|bold,underline Description:|@%n%n", | ||
parameterListHeading = "%n@|bold,underline Parameters:|@%n", | ||
optionListHeading = "%n@|bold,underline Options:|@%n", | ||
header = ["Print available devices and OS versions list to test against"], | ||
description = ["Print available iOS devices and iOS versions list to test against"], | ||
usageHelpAutoWidth = true | ||
) | ||
class IosTestEnvironmentCommand : Runnable { | ||
override fun run() { | ||
println(devicesCatalogAsTable(IosArgs.load(Paths.get(configPath)).project)) | ||
println(softwareVersionsAsTable(IosArgs.load(Paths.get(configPath)).project)) | ||
} | ||
|
||
@CommandLine.Option(names = ["-c", "--config"], description = ["YAML config file path"]) | ||
var configPath: String = FtlConstants.defaultIosConfig | ||
|
||
@CommandLine.Option(names = ["-h", "--help"], usageHelp = true, description = ["Prints this help message"]) | ||
var usageHelpRequested: Boolean = false | ||
} |
16 changes: 16 additions & 0 deletions
16
...runner/src/test/kotlin/ftl/cli/firebase/test/android/AndroidTestEnvironmentCommandTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package ftl.cli.firebase.test.android | ||
|
||
import com.google.common.truth.Truth.assertThat | ||
import org.junit.Test | ||
import picocli.CommandLine | ||
|
||
class AndroidTestEnvironmentCommandTest { | ||
|
||
@Test | ||
fun androidTestEnvironmentCommandShouldParseConfig() { | ||
val cmd = AndroidTestEnvironmentCommand() | ||
CommandLine(cmd).parseArgs("--config=a") | ||
|
||
assertThat(cmd.configPath).isEqualTo("a") | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
test_runner/src/test/kotlin/ftl/cli/firebase/test/ios/IosTestEnvironmentCommandTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package ftl.cli.firebase.test.ios | ||
|
||
import com.google.common.truth.Truth | ||
import org.junit.Test | ||
import picocli.CommandLine | ||
|
||
class IosTestEnvironmentCommandTest { | ||
|
||
@Test | ||
fun iosTestEnvironmentCommandShouldParseConfig() { | ||
val cmd = IosTestEnvironmentCommand() | ||
CommandLine(cmd).parseArgs("--config=a") | ||
|
||
Truth.assertThat(cmd.configPath).isEqualTo("a") | ||
} | ||
} |