test_environment_discovery.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.devtools.testing.v1;
  16. import "google/api/annotations.proto";
  17. import "google/devtools/testing/v1/test_execution.proto";
  18. import "google/protobuf/duration.proto";
  19. import "google/protobuf/timestamp.proto";
  20. import "google/type/date.proto";
  21. import "google/api/client.proto";
  22. option go_package = "google.golang.org/genproto/googleapis/devtools/testing/v1;testing";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "TestEnvironmentDiscoveryProto";
  25. option java_package = "com.google.devtools.testing.v1";
  26. // Service for discovering environments supported by the TestExecutionService.
  27. //
  28. // Over time the TestService may add or remove devices or configuration options
  29. // (e.g., when new devices and APIs are released). Clients should check here
  30. // periodically to discover what options are supported.
  31. //
  32. // It defines the following resource model:
  33. //
  34. // - The API a collection of [TestEnvironmentCatalog]
  35. // [google.devtools.test.v1.TestEnvironmentCatalog] resources, named
  36. // `testEnvironmentCatalog/*`
  37. //
  38. // - Each TestEnvironmentCatalog resource describes a set of supported
  39. // environments.
  40. //
  41. // - An [AndroidDeviceCatalog][google.devtools.test.v1.AndroidDeviceCatalog]
  42. // describes supported Android devices. It contains lists of supported
  43. // [AndroidModels][google.devtools.test.v1.AndroidModel] and
  44. // [AndroidVersions][google.devtools.test.v1.AndroidVersion] along with a
  45. // [AndroidRuntimeConfiguration][google.devtools.test.v1.AndroidRuntimeConfiguration].
  46. // Each AndroidModel contains a list of Versions it supports. All
  47. // models support all locales and orientations described by the
  48. // AndroidRuntimeConfiguration
  49. //
  50. // - An [IosDeviceCatalog][google.devtools.test.v1.IosDeviceCatalog]
  51. // describes supported iOS devices. It contains lists of supported
  52. // [IosModels][google.devtools.test.v1.IosModel] and
  53. // [IosVersions][google.devtools.test.v1.IosVersion] along with a
  54. // [IosRuntimeConfiguration][google.devtools.test.v1.IosRuntimeConfiguration].
  55. // Each IosModel contains a list of Versions it supports. All
  56. // models support all locales and orientations described by the
  57. // IosRuntimeConfiguration.
  58. service TestEnvironmentDiscoveryService {
  59. option (google.api.default_host) = "testing.googleapis.com";
  60. option (google.api.oauth_scopes) =
  61. "https://www.googleapis.com/auth/cloud-platform,"
  62. "https://www.googleapis.com/auth/cloud-platform.read-only";
  63. // Gets the catalog of supported test environments.
  64. //
  65. // May return any of the following canonical error codes:
  66. //
  67. // - INVALID_ARGUMENT - if the request is malformed
  68. // - NOT_FOUND - if the environment type does not exist
  69. // - INTERNAL - if an internal error occurred
  70. rpc GetTestEnvironmentCatalog(GetTestEnvironmentCatalogRequest) returns (TestEnvironmentCatalog) {
  71. option (google.api.http) = {
  72. get: "/v1/testEnvironmentCatalog/{environment_type}"
  73. };
  74. }
  75. }
  76. // A single device IP block
  77. message DeviceIpBlock {
  78. // An IP address block in CIDR notation eg: 34.68.194.64/29
  79. string block = 1;
  80. // Whether this block is used by physical or virtual devices
  81. DeviceForm form = 2;
  82. // The date this block was added to Firebase Test Lab
  83. google.type.Date added_date = 3;
  84. }
  85. // Request to list the currently supported values for an environment type.
  86. message GetTestEnvironmentCatalogRequest {
  87. // Types of environments the Test API supports.
  88. enum EnvironmentType {
  89. // Do not use. For proto versioning only.
  90. ENVIRONMENT_TYPE_UNSPECIFIED = 0;
  91. // A device running a version of the Android OS.
  92. ANDROID = 1;
  93. // A device running a version of iOS.
  94. IOS = 3;
  95. // A network configuration to use when running a test.
  96. NETWORK_CONFIGURATION = 4;
  97. // The software environment provided by TestExecutionService.
  98. PROVIDED_SOFTWARE = 5;
  99. // The IP blocks used by devices in the test environment.
  100. DEVICE_IP_BLOCKS = 6;
  101. }
  102. // Required. The type of environment that should be listed.
  103. EnvironmentType environment_type = 1;
  104. // For authorization, the cloud project requesting the TestEnvironmentCatalog.
  105. string project_id = 2;
  106. }
  107. // A description of a test environment.
  108. message TestEnvironmentCatalog {
  109. // Output only.
  110. oneof environment_catalog {
  111. // Supported Android devices.
  112. AndroidDeviceCatalog android_device_catalog = 1;
  113. // Supported iOS devices.
  114. IosDeviceCatalog ios_device_catalog = 3;
  115. // Supported network configurations.
  116. NetworkConfigurationCatalog network_configuration_catalog = 4;
  117. // The software test environment provided by TestExecutionService.
  118. ProvidedSoftwareCatalog software_catalog = 5;
  119. // The IP blocks used by devices in the test environment.
  120. DeviceIpBlockCatalog device_ip_block_catalog = 6;
  121. }
  122. }
  123. // List of IP blocks used by the Firebase Test Lab
  124. message DeviceIpBlockCatalog {
  125. // The device IP blocks used by Firebase Test Lab
  126. repeated DeviceIpBlock ip_blocks = 1;
  127. }
  128. // The currently supported Android devices.
  129. message AndroidDeviceCatalog {
  130. // The set of supported Android device models.
  131. repeated AndroidModel models = 1;
  132. // The set of supported Android OS versions.
  133. repeated AndroidVersion versions = 2;
  134. // The set of supported runtime configurations.
  135. AndroidRuntimeConfiguration runtime_configuration = 3;
  136. }
  137. // Android configuration that can be selected at the time a test is run.
  138. message AndroidRuntimeConfiguration {
  139. // The set of available locales.
  140. repeated Locale locales = 1;
  141. // The set of available orientations.
  142. repeated Orientation orientations = 2;
  143. }
  144. // A description of an Android device tests may be run on.
  145. message AndroidModel {
  146. // The unique opaque id for this model.
  147. // Use this for invoking the TestExecutionService.
  148. string id = 1;
  149. // The human-readable marketing name for this device model.
  150. // Examples: "Nexus 5", "Galaxy S5".
  151. string name = 2;
  152. // The manufacturer of this device.
  153. string manufacturer = 3;
  154. // The company that this device is branded with.
  155. // Example: "Google", "Samsung".
  156. string brand = 9;
  157. // The name of the industrial design.
  158. // This corresponds to android.os.Build.DEVICE.
  159. string codename = 10;
  160. // Whether this device is virtual or physical.
  161. DeviceForm form = 4;
  162. // Whether this device is a phone, tablet, wearable, etc.
  163. DeviceFormFactor form_factor = 16;
  164. // Screen size in the horizontal (X) dimension measured in pixels.
  165. int32 screen_x = 5;
  166. // Screen size in the vertical (Y) dimension measured in pixels.
  167. int32 screen_y = 6;
  168. // Screen density in DPI.
  169. // This corresponds to ro.sf.lcd_density
  170. int32 screen_density = 12;
  171. // True if and only if tests with this model are recorded by stitching
  172. // together screenshots. See use_low_spec_video_recording in device config.
  173. bool low_fps_video_recording = 17;
  174. // The set of Android versions this device supports.
  175. repeated string supported_version_ids = 7;
  176. // The list of supported ABIs for this device.
  177. // This corresponds to either android.os.Build.SUPPORTED_ABIS (for API level
  178. // 21 and above) or android.os.Build.CPU_ABI/CPU_ABI2.
  179. // The most preferred ABI is the first element in the list.
  180. //
  181. // Elements are optionally prefixed by "version_id:" (where version_id is
  182. // the id of an AndroidVersion), denoting an ABI that is supported only on
  183. // a particular version.
  184. repeated string supported_abis = 11;
  185. // Tags for this dimension.
  186. // Examples: "default", "preview", "deprecated".
  187. repeated string tags = 8;
  188. // URL of a thumbnail image (photo) of the device.
  189. // e.g. https://lh3.googleusercontent.com/90WcauuJiCYABEl8U0lcZeuS5STUbf2yW...
  190. string thumbnail_url = 19;
  191. }
  192. // A version of the Android OS.
  193. message AndroidVersion {
  194. // An opaque id for this Android version.
  195. // Use this id to invoke the TestExecutionService.
  196. string id = 1;
  197. // A string representing this version of the Android OS.
  198. // Examples: "4.3", "4.4".
  199. string version_string = 2;
  200. // The API level for this Android version.
  201. // Examples: 18, 19.
  202. int32 api_level = 3;
  203. // The code name for this Android version.
  204. // Examples: "JellyBean", "KitKat".
  205. string code_name = 4;
  206. // The date this Android version became available in the market.
  207. google.type.Date release_date = 5;
  208. // Market share for this version.
  209. Distribution distribution = 6;
  210. // Tags for this dimension.
  211. // Examples: "default", "preview", "deprecated".
  212. repeated string tags = 7;
  213. }
  214. // Data about the relative number of devices running a
  215. // given configuration of the Android platform.
  216. message Distribution {
  217. // Output only. The time this distribution was measured.
  218. google.protobuf.Timestamp measurement_time = 1;
  219. // Output only. The estimated fraction (0-1) of the total market with this
  220. // configuration.
  221. double market_share = 2;
  222. }
  223. // The currently supported iOS devices.
  224. message IosDeviceCatalog {
  225. // The set of supported iOS device models.
  226. repeated IosModel models = 1;
  227. // The set of supported iOS software versions.
  228. repeated IosVersion versions = 2;
  229. // The set of supported Xcode versions.
  230. repeated XcodeVersion xcode_versions = 4;
  231. // The set of supported runtime configurations.
  232. IosRuntimeConfiguration runtime_configuration = 3;
  233. }
  234. // iOS configuration that can be selected at the time a test is run.
  235. message IosRuntimeConfiguration {
  236. // The set of available locales.
  237. repeated Locale locales = 1;
  238. // The set of available orientations.
  239. repeated Orientation orientations = 2;
  240. }
  241. // A description of an iOS device tests may be run on.
  242. message IosModel {
  243. // The unique opaque id for this model.
  244. // Use this for invoking the TestExecutionService.
  245. string id = 1;
  246. // The human-readable name for this device model.
  247. // Examples: "iPhone 4s", "iPad Mini 2".
  248. string name = 2;
  249. // The set of iOS major software versions this device supports.
  250. repeated string supported_version_ids = 3;
  251. // Tags for this dimension.
  252. // Examples: "default", "preview", "deprecated".
  253. repeated string tags = 4;
  254. // Device capabilities.
  255. // Copied from
  256. // https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html
  257. repeated string device_capabilities = 5;
  258. // Screen size in the horizontal (X) dimension measured in pixels.
  259. int32 screen_x = 7;
  260. // Screen size in the vertical (Y) dimension measured in pixels.
  261. int32 screen_y = 8;
  262. // Screen density in DPI.
  263. int32 screen_density = 9;
  264. // Whether this device is a phone, tablet, wearable, etc.
  265. DeviceFormFactor form_factor = 6;
  266. }
  267. // An iOS version.
  268. message IosVersion {
  269. // An opaque id for this iOS version.
  270. // Use this id to invoke the TestExecutionService.
  271. string id = 1;
  272. // An integer representing the major iOS version.
  273. // Examples: "8", "9".
  274. int32 major_version = 2;
  275. // An integer representing the minor iOS version.
  276. // Examples: "1", "2".
  277. int32 minor_version = 4;
  278. // Tags for this dimension.
  279. // Examples: "default", "preview", "deprecated".
  280. repeated string tags = 3;
  281. // The available Xcode versions for this version.
  282. repeated string supported_xcode_version_ids = 5;
  283. }
  284. // A location/region designation for language.
  285. message Locale {
  286. // The id for this locale.
  287. // Example: "en_US".
  288. string id = 1;
  289. // A human-friendly name for this language/locale.
  290. // Example: "English".
  291. string name = 2;
  292. // A human-friendly string representing the region for this
  293. // locale. Example: "United States". Not present for every locale.
  294. string region = 3;
  295. // Tags for this dimension.
  296. // Example: "default".
  297. repeated string tags = 4;
  298. }
  299. // Screen orientation of the device.
  300. message Orientation {
  301. // The id for this orientation.
  302. // Example: "portrait".
  303. string id = 1;
  304. // A human-friendly name for this orientation.
  305. // Example: "portrait".
  306. string name = 2;
  307. // Tags for this dimension.
  308. // Example: "default".
  309. repeated string tags = 3;
  310. }
  311. // An Xcode version that an iOS version is compatible with.
  312. message XcodeVersion {
  313. // The id for this version.
  314. // Example: "9.2".
  315. string version = 1;
  316. // Tags for this Xcode version.
  317. // Example: "default".
  318. repeated string tags = 2;
  319. }
  320. message NetworkConfigurationCatalog {
  321. repeated NetworkConfiguration configurations = 1;
  322. }
  323. message NetworkConfiguration {
  324. // The unique opaque id for this network traffic configuration.
  325. string id = 1;
  326. // The emulation rule applying to the upload traffic.
  327. TrafficRule up_rule = 2;
  328. // The emulation rule applying to the download traffic.
  329. TrafficRule down_rule = 3;
  330. }
  331. // Network emulation parameters.
  332. message TrafficRule {
  333. // Packet delay, must be >= 0.
  334. google.protobuf.Duration delay = 1;
  335. // Packet loss ratio (0.0 - 1.0).
  336. float packet_loss_ratio = 2;
  337. // Packet duplication ratio (0.0 - 1.0).
  338. float packet_duplication_ratio = 3;
  339. // Bandwidth in kbits/second.
  340. float bandwidth = 4;
  341. // Burst size in kbits.
  342. float burst = 5;
  343. }
  344. // The currently provided software environment on the devices under test.
  345. message ProvidedSoftwareCatalog {
  346. // A string representing the current version of Android Test Orchestrator
  347. // that is used in the environment. The package is available at
  348. // https://maven.google.com/web/index.html#com.android.support.test:orchestrator.
  349. string orchestrator_version = 1;
  350. // A string representing the current version of AndroidX Test Orchestrator
  351. // that is used in the environment. The package is available at
  352. // https://maven.google.com/web/index.html#androidx.test:orchestrator.
  353. string androidx_orchestrator_version = 2;
  354. }
  355. // Whether the device is physical or virtual.
  356. enum DeviceForm {
  357. // Do not use. For proto versioning only.
  358. DEVICE_FORM_UNSPECIFIED = 0;
  359. // Android virtual device using Compute Engine native virtualization. Firebase
  360. // Test Lab only.
  361. VIRTUAL = 1;
  362. // Actual hardware.
  363. PHYSICAL = 2;
  364. // Android virtual device using emulator in nested virtualization. Equivalent
  365. // to Android Studio.
  366. EMULATOR = 3;
  367. }
  368. // The form factor of a device.
  369. enum DeviceFormFactor {
  370. // Do not use. For proto versioning only.
  371. DEVICE_FORM_FACTOR_UNSPECIFIED = 0;
  372. // This device has the shape of a phone.
  373. PHONE = 1;
  374. // This device has the shape of a tablet.
  375. TABLET = 2;
  376. // This device has the shape of a watch or other wearable.
  377. WEARABLE = 3;
  378. }