Skip to content
Open
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ You can also run this step directly with [Bitrise CLI](https://github.com/bitris
| `inst_test_runner_class` | The fully-qualified Java class name of the instrumentation test runner (leave empty to use the last name extracted from the APK manifest). | | |
| `inst_test_targets` | A list of one or more instrumentation test targets to be run (default: all targets). Each target must be fully qualified with the package name or class name, in one of these formats: - `package package_name` - `class package_name.class_name` - `class package_name.class_name#method_name` For example: `class com.my.company.app.MyTargetClass,class com.my.company.app.MyOtherTargetClass` | | |
| `inst_use_orchestrator` | The option of whether running each test within its own invocation of instrumentation with Android Test Orchestrator or not. | required | `false` |
| `inst_num_uniform_shards` | The number of uniform shards across which to distribute test cases. The shards are run in parallel on separate devices, a value between 1 and 50. | | |
| `robo_initial_activity` | The initial activity used to start the app during a robo test. (leave empty to get it extracted from the APK manifest) | | |
| `robo_max_depth` | The maximum depth of the traversal stack a robo test can explore. Needs to be at least 2 to make Robo explore the app beyond the first activity(leave empty to use the default value: `50`) | | |
| `robo_max_steps` | The maximum number of steps/actions a robo test can execute(leave empty to use the default value: `no limit`). | | |
Expand Down
10 changes: 6 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ type ConfigsModel struct {
VerboseLog bool `env:"use_verbose_log,opt[true,false]"`

// instrumentation
InstTestPackageID string `env:"inst_test_package_id"`
InstTestRunnerClass string `env:"inst_test_runner_class"`
InstTestTargets string `env:"inst_test_targets"`
UseOrchestrator bool `env:"inst_use_orchestrator,opt[true,false]"`
InstTestPackageID string `env:"inst_test_package_id"`
InstTestRunnerClass string `env:"inst_test_runner_class"`
InstTestTargets string `env:"inst_test_targets"`
UseOrchestrator bool `env:"inst_use_orchestrator,opt[true,false]"`
NumberOfUniformShards int `env:"inst_num_uniform_shards,range[0..50]"`

// robo
RoboInitialActivity string `env:"robo_initial_activity"`
Expand Down Expand Up @@ -113,6 +114,7 @@ func (configs *ConfigsModel) print() {
log.Printf("- InstTestRunnerClass: %s", configs.InstTestRunnerClass)
log.Printf("- InstTestTargets: %s", configs.InstTestTargets)
log.Printf("- UseOrchestrator: %t", configs.UseOrchestrator)
log.Printf("- NumberOfUniformShards: %d", configs.NumberOfUniformShards)
}

//robo
Expand Down
8 changes: 8 additions & 0 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ inputs:
value_options:
- "false"
- "true"
- inst_num_uniform_shards:
opts:
title: "Uniform shards number"
summary: |
The number of shards across which to distribute test cases. The shards are run in parallel on separate devices.
description: |
A value between 1 and 50. For example, if your test execution contains 20 test cases and you specify four shards, the instrumentation command passes arguments of `-e numShards 4` to `AndroidJUnitRunner` and each shard executes about five test cases. Based on the sharding mechanism `AndroidJUnitRunner` uses, there is no guarantee that test cases will be distributed with perfect uniformity.
If zero is specified then no uniform sharding is applied and all test cases run on a single device.
- robo_initial_activity:
opts:
category: "Robo Test"
Expand Down
6 changes: 6 additions & 0 deletions test_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ func startTestRun(configs ConfigsModel, testAssets TestAssetsAndroid) error {
} else {
testModel.TestSpecification.AndroidInstrumentationTest.OrchestratorOption = "DO_NOT_USE_ORCHESTRATOR"
}

if int64(configs.NumberOfUniformShards) > 0 {
testModel.TestSpecification.AndroidInstrumentationTest.ShardingOption = &testing.ShardingOption{}
testModel.TestSpecification.AndroidInstrumentationTest.ShardingOption.UniformSharding = &testing.UniformSharding{}
testModel.TestSpecification.AndroidInstrumentationTest.ShardingOption.UniformSharding.NumShards = int64(configs.NumberOfUniformShards)
}
log.Debugf("AndroidInstrumentationTest: %+v", testModel.TestSpecification.AndroidInstrumentationTest)
case testTypeRobo:
testModel.TestSpecification.AndroidRoboTest = &testing.AndroidRoboTest{}
Expand Down