Skip to content

Commit

Permalink
#835 added printing all test environment information (#901)
Browse files Browse the repository at this point in the history
* #835 added printing all test environment information

* #835 updated release notes
  • Loading branch information
piotradamczyk5 authored Jul 20, 2020
1 parent 742030d commit 611e0f0
Show file tree
Hide file tree
Showing 11 changed files with 115 additions and 2 deletions.
1 change: 1 addition & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [#895](https://github.com/Flank/flank/pull/895) Added option to print iOS available devices to test against. ([piotradamczyk5](https://github.com/piotradamczyk5))
- [#894](https://github.com/Flank/flank/pull/894) Added option to print Android available versions to test against. ([piotradamczyk5](https://github.com/piotradamczyk5))
- [#897](https://github.com/Flank/flank/pull/897) Added option to print iOS available versions to test against. ([piotradamczyk5](https://github.com/piotradamczyk5))
- [#901](https://github.com/Flank/flank/pull/901) Added option to print Android and iOS available test-environment. ([piotradamczyk5](https://github.com/piotradamczyk5))
-
-
-
Expand Down
3 changes: 3 additions & 0 deletions test_runner/docs/ascii/flank.jar_-android.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ flank.jar
*versions*::
Information about available software versions

*test-environment*::
Print available devices and OS versions list to test against

// end::picocli-generated-man-section-commands[]

// end::picocli-generated-full-manpage[]
3 changes: 3 additions & 0 deletions test_runner/docs/ascii/flank.jar_-firebase-test-android.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ flank.jar
*versions*::
Information about available software versions

*test-environment*::
Print available devices and OS versions list to test against

// end::picocli-generated-man-section-commands[]

// end::picocli-generated-full-manpage[]
3 changes: 3 additions & 0 deletions test_runner/docs/ascii/flank.jar_-firebase-test-ios.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ flank.jar
*versions*::
Information about available software versions

*test-environment*::
Print available devices and OS versions list to test against

// end::picocli-generated-man-section-commands[]

// end::picocli-generated-full-manpage[]
3 changes: 3 additions & 0 deletions test_runner/docs/ascii/flank.jar_-ios.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ flank.jar
*versions*::
Information about available software versions

*test-environment*::
Print available devices and OS versions list to test against

// end::picocli-generated-man-section-commands[]

// end::picocli-generated-full-manpage[]
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ftl.cli.firebase.test

import ftl.cli.firebase.test.android.AndroidDoctorCommand
import ftl.cli.firebase.test.android.AndroidRunCommand
import ftl.cli.firebase.test.android.AndroidTestEnvironmentCommand
import ftl.cli.firebase.test.android.models.AndroidModelsCommand
import ftl.cli.firebase.test.android.versions.AndroidVersionsCommand
import picocli.CommandLine
Expand All @@ -14,7 +15,8 @@ import picocli.CommandLine.Command
AndroidRunCommand::class,
AndroidDoctorCommand::class,
AndroidModelsCommand::class,
AndroidVersionsCommand::class
AndroidVersionsCommand::class,
AndroidTestEnvironmentCommand::class
],
usageHelpAutoWidth = true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ftl.cli.firebase.test

import ftl.cli.firebase.test.ios.IosDoctorCommand
import ftl.cli.firebase.test.ios.IosRunCommand
import ftl.cli.firebase.test.ios.IosTestEnvironmentCommand
import ftl.cli.firebase.test.ios.models.IosModelsCommand
import ftl.cli.firebase.test.ios.versions.IosVersionsCommand
import picocli.CommandLine
Expand All @@ -14,7 +15,8 @@ import picocli.CommandLine.Command
IosRunCommand::class,
IosDoctorCommand::class,
IosModelsCommand::class,
IosVersionsCommand::class
IosVersionsCommand::class,
IosTestEnvironmentCommand::class
],
usageHelpAutoWidth = true
)
Expand Down
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
}
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
}
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")
}
}
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")
}
}

0 comments on commit 611e0f0

Please sign in to comment.