Skip to content

Commit

Permalink
Sharding (#621)
Browse files Browse the repository at this point in the history
* Update testing_v1.json with ManualSharding support

* Regenerate test api

* WIP manual sharding

* Fix shard guard logic

* Fix wildcards import

* Update client

* Restrict shard count instead of test methods count per shard.

* Fix num_shard comment

* Generate different test apks automatically

* Fix GCS output directory path for android manual sharding

* Fix wrong path's in test yml files

* Change depricated flag 'disableSharding' => 'disable-sharding'

* Fix bug where flag 'disable-sharding' causes bad request to TL

* Remove test artifacts

* Fix ObjPath parsing for new Android manual sharding

* Fix shard name Regex

Co-authored-by: Pawel <[email protected]>
Co-authored-by: jan-gogo <[email protected]>
  • Loading branch information
3 people authored Feb 26, 2020
1 parent a36dae2 commit 9871d9e
Show file tree
Hide file tree
Showing 41 changed files with 1,152 additions and 148 deletions.
88 changes: 86 additions & 2 deletions firebase_apis/json/testing_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
}
}
},
"revision": "20191008",
"revision": "20200205",
"rootUrl": "https://testing.googleapis.com/",
"schemas": {
"Account": {
Expand Down Expand Up @@ -378,6 +378,10 @@
],
"type": "string"
},
"shardingOption": {
"$ref": "ShardingOption",
"description": "The option to run tests in multiple shards in parallel."
},
"testApk": {
"$ref": "FileReference",
"description": "Required. The APK containing the test code to be executed."
Expand Down Expand Up @@ -1056,7 +1060,7 @@
"type": "object"
},
"IosModel": {
"description": "A description of an iOS device tests may be run on.\nNext tag: 10",
"description": "A description of an iOS device tests may be run on.\nNext tag: 11",
"id": "IosModel",
"properties": {
"deviceCapabilities": {
Expand Down Expand Up @@ -1267,6 +1271,20 @@
},
"type": "object"
},
"ManualSharding": {
"description": "Shards test cases into the specified groups of packages, classes, and/or\nmethods.\n\nWith manual sharding enabled, specifying test targets via\nenvironment_variables or in InstrumentationTest is invalid.",
"id": "ManualSharding",
"properties": {
"testTargetsForShard": {
"description": "Required. Group of packages, classes, and/or test methods to be run for\neach shard. The number of shard_test_targets must be >= 1 and <= 50.",
"items": {
"$ref": "TestTargetsForShard"
},
"type": "array"
}
},
"type": "object"
},
"NetworkConfiguration": {
"id": "NetworkConfiguration",
"properties": {
Expand Down Expand Up @@ -1434,6 +1452,42 @@
},
"type": "object"
},
"Shard": {
"description": "Output only. Details about the shard.",
"id": "Shard",
"properties": {
"numShards": {
"description": "Output only. The total number of shards.",
"format": "int32",
"type": "integer"
},
"shardIndex": {
"description": "Output only. The index of the shard among all the shards.",
"format": "int32",
"type": "integer"
},
"testTargetsForShard": {
"$ref": "TestTargetsForShard",
"description": "Output only. Test targets for each shard."
}
},
"type": "object"
},
"ShardingOption": {
"description": "Options for enabling sharding.",
"id": "ShardingOption",
"properties": {
"manualSharding": {
"$ref": "ManualSharding",
"description": "Shards test cases into the specified groups of packages, classes, and/or\nmethods."
},
"uniformSharding": {
"$ref": "UniformSharding",
"description": "Uniformly shards test cases given a total number of shards."
}
},
"type": "object"
},
"StartActivityIntent": {
"description": "A starting intent specified by an action, uri, and categories.",
"id": "StartActivityIntent",
Expand Down Expand Up @@ -1517,6 +1571,10 @@
"description": "Output only. The cloud project that owns the test execution.",
"type": "string"
},
"shard": {
"$ref": "Shard",
"description": "Output only. Details about the shard."
},
"state": {
"description": "Output only. Indicates the current progress of the test execution\n(e.g., FINISHED).",
"enum": [
Expand Down Expand Up @@ -1832,6 +1890,20 @@
},
"type": "object"
},
"TestTargetsForShard": {
"description": "Test targets for a shard.",
"id": "TestTargetsForShard",
"properties": {
"testTargets": {
"description": "Group of packages, classes, and/or test methods to be run for each shard.\nThe targets need to be specified in AndroidJUnitRunner argument format. For\nexample, “package com.my.packages” “class com.my.package.MyClass”.\n\nThe number of shard_test_targets must be greater than 0.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"ToolResultsExecution": {
"description": "Represents a tool results execution resource.\n\nThis has the results of a TestMatrix.",
"id": "ToolResultsExecution",
Expand Down Expand Up @@ -1921,6 +1993,18 @@
},
"type": "object"
},
"UniformSharding": {
"description": "Uniformly shards test cases given a total number of shards.\n\nFor Instrumentation test, it will be translated to “-e numShard” “-e\nshardIndex” AndroidJUnitRunner arguments. With uniform sharding enabled,\nspecifying these sharding arguments via environment_variables is invalid.",
"id": "UniformSharding",
"properties": {
"numShards": {
"description": "Required. Total number of shards. The number must be >= 1 and <= 50.",
"format": "int32",
"type": "integer"
}
},
"type": "object"
},
"XcodeVersion": {
"description": "An Xcode version that an iOS version is compatible with.",
"id": "XcodeVersion",
Expand Down
Loading

0 comments on commit 9871d9e

Please sign in to comment.