Skip to content

Commit

Permalink
#835 Fixed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Adamczyk committed Jul 13, 2020
1 parent dd9175d commit a9a6634
Show file tree
Hide file tree
Showing 40 changed files with 841 additions and 165 deletions.
17 changes: 3 additions & 14 deletions test_runner/docs/ascii/flank.jar_-android-run.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ flank.jar

*flank.jar
android run* [*-h*] [*--async*] [*--auto-google-login*]
[*--available-devices*] [*--available-environment*]
[*--available-software-versions*]
[*--disable-results-upload*] [*--disable-sharding*] [*--dry*]
[*--dump-shards*] [*--full-junit-result*]
[*--ignore-failed-tests*] [*--keep-file-path*]
Expand Down Expand Up @@ -84,18 +82,12 @@ Configuration is read from flank.yml
*--obfuscate*::
Replacing internal test names with unique identifiers when using --dump-shards option to avoid exposing internal details

*--available-devices*::
Print current list of devices available to test against

*--available-software-versions*::
Print current list of OS versions available to test against

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

*--device*=_<String=String>_[,_<String=String>_...]::
A list of DIMENSION=VALUE pairs which specify a target device to test against. This flag may be repeated to specify multiple devices. The four device dimensions are: model, version, locale, and orientation. If any dimensions are omitted, they will use a default value. Omitting all of the preceding dimension-related flags will run tests against a single device using defaults for all four device dimensions.

*--async*::
Invoke a test asynchronously without waiting for test results.

*--results-bucket*=_<resultsBucket>_::
The name of a Google Cloud Storage bucket where raw test results will be stored (default: "test-lab-<random-UUID>"). Note that the bucket must be owned by a billing-enabled project, and that using a non-default bucket will result in billing charges for the storage used.

Expand All @@ -111,9 +103,6 @@ Configuration is read from flank.yml
*--timeout*=_<timeout>_::
The max time this test execution can run before it is cancelled (default: 15m). It does not include any time necessary to prepare and clean up the target device. The maximum possible testing time is 30m on physical devices and 60m on virtual devices. The TIMEOUT units can be h, m, or s. If no unit is given, seconds are assumed.

*--async*::
Invoke a test asynchronously without waiting for test results.

*--client-details*=_<String=String>_[,_<String=String>_...]::
Comma-separated, KEY=VALUE map of additional details to attach to the test matrix.Arbitrary KEY=VALUE pairs may be attached to a test matrix to provide additional context about the tests being run.When consuming the test results, such as in Cloud Functions or a CI system,these details can add additional context such as a link to the corresponding pull request.

Expand Down
9 changes: 9 additions & 0 deletions test_runner/docs/ascii/flank.jar_-android.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ flank.jar
*doctor*::
Verifies flank firebase is setup correctly

*models*::
Information about available models

*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[]
18 changes: 3 additions & 15 deletions test_runner/docs/ascii/flank.jar_-firebase-test-android-run.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ flank.jar

*flank.jar
firebase test android run* [*-h*] [*--async*] [*--auto-google-login*]
[*--available-devices*]
[*--available-environment*]
[*--available-software-versions*]
[*--disable-results-upload*]
[*--disable-sharding*] [*--dry*]
[*--dump-shards*] [*--full-junit-result*]
Expand Down Expand Up @@ -97,18 +94,12 @@ Configuration is read from flank.yml
*--obfuscate*::
Replacing internal test names with unique identifiers when using --dump-shards option to avoid exposing internal details

*--available-devices*::
Print current list of devices available to test against

*--available-software-versions*::
Print current list of OS versions available to test against

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

*--device*=_<String=String>_[,_<String=String>_...]::
A list of DIMENSION=VALUE pairs which specify a target device to test against. This flag may be repeated to specify multiple devices. The four device dimensions are: model, version, locale, and orientation. If any dimensions are omitted, they will use a default value. Omitting all of the preceding dimension-related flags will run tests against a single device using defaults for all four device dimensions.

*--async*::
Invoke a test asynchronously without waiting for test results.

*--results-bucket*=_<resultsBucket>_::
The name of a Google Cloud Storage bucket where raw test results will be stored (default: "test-lab-<random-UUID>"). Note that the bucket must be owned by a billing-enabled project, and that using a non-default bucket will result in billing charges for the storage used.

Expand All @@ -124,9 +115,6 @@ Configuration is read from flank.yml
*--timeout*=_<timeout>_::
The max time this test execution can run before it is cancelled (default: 15m). It does not include any time necessary to prepare and clean up the target device. The maximum possible testing time is 30m on physical devices and 60m on virtual devices. The TIMEOUT units can be h, m, or s. If no unit is given, seconds are assumed.

*--async*::
Invoke a test asynchronously without waiting for test results.

*--client-details*=_<String=String>_[,_<String=String>_...]::
Comma-separated, KEY=VALUE map of additional details to attach to the test matrix.Arbitrary KEY=VALUE pairs may be attached to a test matrix to provide additional context about the tests being run.When consuming the test results, such as in Cloud Functions or a CI system,these details can add additional context such as a link to the corresponding pull request.

Expand Down
9 changes: 9 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 @@ -32,6 +32,15 @@ flank.jar
*doctor*::
Verifies flank firebase is setup correctly

*models*::
Information about available models

*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[]
20 changes: 4 additions & 16 deletions test_runner/docs/ascii/flank.jar_-firebase-test-ios-run.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ flank.jar
== Synopsis

*flank.jar
firebase test ios run* [*-h*] [*--async*] [*--available-devices*]
[*--available-environment*]
[*--available-software-versions*]
[*--disable-results-upload*]
firebase test ios run* [*-h*] [*--async*] [*--disable-results-upload*]
[*--disable-sharding*] [*--dry*] [*--dump-shards*]
[*--full-junit-result*] [*--ignore-failed-tests*]
[*--keep-file-path*] [*--no-record-video*]
Expand Down Expand Up @@ -76,18 +73,12 @@ Configuration is read from flank.yml
*--obfuscate*::
Replacing internal test names with unique identifiers when using --dump-shards option to avoid exposing internal details

*--available-devices*::
Print current list of devices available to test against

*--available-software-versions*::
Print current list of OS versions available to test against

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

*--device*=_<String=String>_[,_<String=String>_...]::
A list of DIMENSION=VALUE pairs which specify a target device to test against. This flag may be repeated to specify multiple devices. The four device dimensions are: model, version, locale, and orientation. If any dimensions are omitted, they will use a default value. Omitting all of the preceding dimension-related flags will run tests against a single device using defaults for all four device dimensions.

*--async*::
Invoke a test asynchronously without waiting for test results.

*--results-bucket*=_<resultsBucket>_::
The name of a Google Cloud Storage bucket where raw test results will be stored (default: "test-lab-<random-UUID>"). Note that the bucket must be owned by a billing-enabled project, and that using a non-default bucket will result in billing charges for the storage used.

Expand All @@ -103,9 +94,6 @@ Configuration is read from flank.yml
*--timeout*=_<timeout>_::
The max time this test execution can run before it is cancelled (default: 15m). It does not include any time necessary to prepare and clean up the target device. The maximum possible testing time is 30m on physical devices and 60m on virtual devices. The TIMEOUT units can be h, m, or s. If no unit is given, seconds are assumed.

*--async*::
Invoke a test asynchronously without waiting for test results.

*--client-details*=_<String=String>_[,_<String=String>_...]::
Comma-separated, KEY=VALUE map of additional details to attach to the test matrix.Arbitrary KEY=VALUE pairs may be attached to a test matrix to provide additional context about the tests being run.When consuming the test results, such as in Cloud Functions or a CI system,these details can add additional context such as a link to the corresponding pull request.

Expand Down
9 changes: 9 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 @@ -32,6 +32,15 @@ flank.jar
*doctor*::
Verifies flank firebase is setup correctly

*models*::
Information about available models

*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[]
29 changes: 9 additions & 20 deletions test_runner/docs/ascii/flank.jar_-ios-run.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ flank.jar
== Synopsis

*flank.jar
ios run* [*-h*] [*--async*] [*--available-devices*]
[*--available-environment*] [*--available-software-versions*]
[*--disable-results-upload*] [*--disable-sharding*] [*--dry*]
[*--dump-shards*] [*--full-junit-result*]
[*--ignore-failed-tests*] [*--keep-file-path*]
[*--no-record-video*] [*--obfuscate*] [*--record-video*]
[*--smart-flank-disable-upload*] [*-c*=_<configPath>_]
[*--local-result-dir*=_<localResultsDir>_]
ios run* [*-h*] [*--async*] [*--disable-results-upload*]
[*--disable-sharding*] [*--dry*] [*--dump-shards*]
[*--full-junit-result*] [*--ignore-failed-tests*]
[*--keep-file-path*] [*--no-record-video*] [*--obfuscate*]
[*--record-video*] [*--smart-flank-disable-upload*]
[*-c*=_<configPath>_] [*--local-result-dir*=_<localResultsDir>_]
[*--max-test-shards*=_<maxTestShards>_]
[*--network-profile*=_<networkProfile>_]
[*--num-flaky-test-attempts*=_<flakyTestAttempts>_]
Expand Down Expand Up @@ -67,18 +65,12 @@ Configuration is read from flank.yml
*--obfuscate*::
Replacing internal test names with unique identifiers when using --dump-shards option to avoid exposing internal details

*--available-devices*::
Print current list of devices available to test against

*--available-software-versions*::
Print current list of OS versions available to test against

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

*--device*=_<String=String>_[,_<String=String>_...]::
A list of DIMENSION=VALUE pairs which specify a target device to test against. This flag may be repeated to specify multiple devices. The four device dimensions are: model, version, locale, and orientation. If any dimensions are omitted, they will use a default value. Omitting all of the preceding dimension-related flags will run tests against a single device using defaults for all four device dimensions.

*--async*::
Invoke a test asynchronously without waiting for test results.

*--results-bucket*=_<resultsBucket>_::
The name of a Google Cloud Storage bucket where raw test results will be stored (default: "test-lab-<random-UUID>"). Note that the bucket must be owned by a billing-enabled project, and that using a non-default bucket will result in billing charges for the storage used.

Expand All @@ -94,9 +86,6 @@ Configuration is read from flank.yml
*--timeout*=_<timeout>_::
The max time this test execution can run before it is cancelled (default: 15m). It does not include any time necessary to prepare and clean up the target device. The maximum possible testing time is 30m on physical devices and 60m on virtual devices. The TIMEOUT units can be h, m, or s. If no unit is given, seconds are assumed.

*--async*::
Invoke a test asynchronously without waiting for test results.

*--client-details*=_<String=String>_[,_<String=String>_...]::
Comma-separated, KEY=VALUE map of additional details to attach to the test matrix.Arbitrary KEY=VALUE pairs may be attached to a test matrix to provide additional context about the tests being run.When consuming the test results, such as in Cloud Functions or a CI system,these details can add additional context such as a link to the corresponding pull request.

Expand Down
9 changes: 9 additions & 0 deletions test_runner/docs/ascii/flank.jar_-ios.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ flank.jar
*doctor*::
Verifies flank firebase is setup correctly

*models*::
Information about available models

*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,9 @@ 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
import picocli.CommandLine.Command

Expand All @@ -10,7 +13,10 @@ import picocli.CommandLine.Command
synopsisHeading = "",
subcommands = [
AndroidRunCommand::class,
AndroidDoctorCommand::class
AndroidDoctorCommand::class,
AndroidModelsCommand::class,
AndroidVersionsCommand::class,
AndroidTestEnvironmentCommand::class
],
usageHelpAutoWidth = true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,7 @@ abstract class CommonRunCommand {
@CommandLine.Option(
names = ["--obfuscate"],
description = ["Replacing internal test names with unique identifiers when using --dump-shards option " +
"to avoid exposing internal details"])
"to avoid exposing internal details"]
)
var obfuscate: Boolean = false

@CommandLine.Option(
names = ["--available-devices"],
description = ["Print current list of devices available to test against"])
var printAvailableDevices: Boolean = false

@CommandLine.Option(
names = ["--available-software-versions"],
description = ["Print current list of OS versions available to test against"])
var printAvailableSoftwareVersions: Boolean = false

@CommandLine.Option(
names = ["--available-environment"],
description = ["Print available devices and OS versions list to test against"])
var printAvailableEnvironment: Boolean = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ 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
import picocli.CommandLine.Command

Expand All @@ -10,7 +13,10 @@ import picocli.CommandLine.Command
synopsisHeading = "",
subcommands = [
IosRunCommand::class,
IosDoctorCommand::class
IosDoctorCommand::class,
IosModelsCommand::class,
IosVersionsCommand::class,
IosTestEnvironmentCommand::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.android

import ftl.args.AndroidArgs
import ftl.cli.firebase.test.processValidation
import ftl.config.FtlConstants
import ftl.doctor.Doctor.validateYaml
import java.nio.file.Paths
import picocli.CommandLine.Command
Expand All @@ -28,7 +29,7 @@ class AndroidDoctorCommand : Runnable {
}

@Option(names = ["-c", "--config"], description = ["YAML config file path"])
var configPath: String = "./flank.yml"
var configPath: String = FtlConstants.defaultAndroidConfig

@Option(names = ["-h", "--help"], usageHelp = true, description = ["Prints this help message"])
var usageHelpRequested: Boolean = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package ftl.cli.firebase.test.android

import ftl.android.AndroidCatalog.devicesCatalogAsTable
import ftl.android.AndroidCatalog.supportedVersionsAsTable
import ftl.args.AndroidArgs
import ftl.cli.firebase.test.CommonRunCommand
import ftl.config.FtlConstants
Expand Down Expand Up @@ -48,16 +46,9 @@ class AndroidRunCommand : CommonRunCommand(), Runnable {
val config = AndroidArgs.load(Paths.get(configPath), cli = this)

runBlocking {
when {
dumpShards -> dumpShards(args = config, obfuscatedOutput = obfuscate)
printAvailableEnvironment -> {
println(devicesCatalogAsTable(config.project))
println(supportedVersionsAsTable(config.project))
}
printAvailableDevices -> println(devicesCatalogAsTable(config.project))
printAvailableSoftwareVersions -> println(supportedVersionsAsTable(config.project))
else -> newTestRun(config)
}
if (dumpShards)
dumpShards(args = config, obfuscatedOutput = obfuscate) else
newTestRun(config)
}
}

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
}
Loading

0 comments on commit a9a6634

Please sign in to comment.