xref: /aosp_15_r20/external/googleapis/google/devtools/testing/v1/test_environment_discovery.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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
15syntax = "proto3";
16
17package google.devtools.testing.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/protobuf/duration.proto";
23import "google/protobuf/timestamp.proto";
24import "google/type/date.proto";
25
26option go_package = "google.golang.org/genproto/googleapis/devtools/testing/v1;testing";
27option java_multiple_files = true;
28option java_outer_classname = "TestEnvironmentDiscoveryProto";
29option java_package = "com.google.devtools.testing.v1";
30
31// Service for discovering environments supported by the TestExecutionService.
32//
33// Over time the TestService may add or remove devices or configuration options
34// (e.g., when new devices and APIs are released).  Clients should check here
35// periodically to discover what options are supported.
36//
37// It defines the following resource model:
38//
39// - The API a collection of [TestEnvironmentCatalog]
40//   [google.devtools.test.v1.TestEnvironmentCatalog] resources, named
41//   `testEnvironmentCatalog/*`
42//
43// - Each TestEnvironmentCatalog resource describes a set of supported
44//   environments.
45//
46// - An [AndroidDeviceCatalog][google.devtools.test.v1.AndroidDeviceCatalog]
47//   describes supported Android devices. It contains lists of supported
48//   [AndroidModels][google.devtools.test.v1.AndroidModel] and
49//   [AndroidVersions][google.devtools.test.v1.AndroidVersion] along with a
50//   [AndroidRuntimeConfiguration][google.devtools.test.v1.AndroidRuntimeConfiguration].
51//   Each AndroidModel contains a list of Versions it supports. All
52//   models support all locales and orientations described by the
53//   AndroidRuntimeConfiguration
54//
55// - An [IosDeviceCatalog][google.devtools.test.v1.IosDeviceCatalog]
56//   describes supported iOS devices. It contains lists of supported
57//   [IosModels][google.devtools.test.v1.IosModel] and
58//   [IosVersions][google.devtools.test.v1.IosVersion] along with a
59//   [IosRuntimeConfiguration][google.devtools.test.v1.IosRuntimeConfiguration].
60//   Each IosModel contains a list of Versions it supports. All
61//   models support all locales and orientations described by the
62//   IosRuntimeConfiguration.
63service TestEnvironmentDiscoveryService {
64  option (google.api.default_host) = "testing.googleapis.com";
65  option (google.api.oauth_scopes) =
66      "https://www.googleapis.com/auth/cloud-platform,"
67      "https://www.googleapis.com/auth/cloud-platform.read-only";
68
69  // Gets the catalog of supported test environments.
70  //
71  // May return any of the following canonical error codes:
72  //
73  // - INVALID_ARGUMENT - if the request is malformed
74  // - NOT_FOUND - if the environment type does not exist
75  // - INTERNAL - if an internal error occurred
76  rpc GetTestEnvironmentCatalog(GetTestEnvironmentCatalogRequest)
77      returns (TestEnvironmentCatalog) {
78    option (google.api.http) = {
79      get: "/v1/testEnvironmentCatalog/{environment_type}"
80    };
81  }
82}
83
84// A single device IP block
85message DeviceIpBlock {
86  // An IP address block in CIDR notation eg: 34.68.194.64/29
87  string block = 1;
88
89  // Whether this block is used by physical or virtual devices
90  DeviceForm form = 2;
91
92  // The date this block was added to Firebase Test Lab
93  google.type.Date added_date = 3;
94}
95
96// Request to list the currently supported values for an environment type.
97message GetTestEnvironmentCatalogRequest {
98  // Types of environments the Test API supports.
99  enum EnvironmentType {
100    // Do not use.  For proto versioning only.
101    ENVIRONMENT_TYPE_UNSPECIFIED = 0;
102
103    // A device running a version of the Android OS.
104    ANDROID = 1;
105
106    // A device running a version of iOS.
107    IOS = 3;
108
109    // A network configuration to use when running a test.
110    NETWORK_CONFIGURATION = 4;
111
112    // The software environment provided by TestExecutionService.
113    PROVIDED_SOFTWARE = 5;
114
115    // The IP blocks used by devices in the test environment.
116    DEVICE_IP_BLOCKS = 6;
117  }
118
119  // Required. The type of environment that should be listed.
120  EnvironmentType environment_type = 1;
121
122  // For authorization, the cloud project requesting the TestEnvironmentCatalog.
123  string project_id = 2;
124}
125
126// A description of a test environment.
127message TestEnvironmentCatalog {
128  // Output only.
129  oneof environment_catalog {
130    // Supported Android devices.
131    AndroidDeviceCatalog android_device_catalog = 1;
132
133    // Supported iOS devices.
134    IosDeviceCatalog ios_device_catalog = 3;
135
136    // Supported network configurations.
137    NetworkConfigurationCatalog network_configuration_catalog = 4;
138
139    // The software test environment provided by TestExecutionService.
140    ProvidedSoftwareCatalog software_catalog = 5;
141
142    // The IP blocks used by devices in the test environment.
143    DeviceIpBlockCatalog device_ip_block_catalog = 6;
144  }
145}
146
147// List of IP blocks used by the Firebase Test Lab
148message DeviceIpBlockCatalog {
149  // The device IP blocks used by Firebase Test Lab
150  repeated DeviceIpBlock ip_blocks = 1;
151}
152
153// The currently supported Android devices.
154message AndroidDeviceCatalog {
155  // The set of supported Android device models.
156  repeated AndroidModel models = 1;
157
158  // The set of supported Android OS versions.
159  repeated AndroidVersion versions = 2;
160
161  // The set of supported runtime configurations.
162  AndroidRuntimeConfiguration runtime_configuration = 3;
163}
164
165// Android configuration that can be selected at the time a test is run.
166message AndroidRuntimeConfiguration {
167  // The set of available locales.
168  repeated Locale locales = 1;
169
170  // The set of available orientations.
171  repeated Orientation orientations = 2;
172}
173
174// A description of an Android device tests may be run on.
175message AndroidModel {
176  // The unique opaque id for this model.
177  // Use this for invoking the TestExecutionService.
178  string id = 1;
179
180  // The human-readable marketing name for this device model.
181  // Examples: "Nexus 5", "Galaxy S5".
182  string name = 2;
183
184  // The manufacturer of this device.
185  string manufacturer = 3;
186
187  // The company that this device is branded with.
188  // Example: "Google", "Samsung".
189  string brand = 9;
190
191  // The name of the industrial design.
192  // This corresponds to android.os.Build.DEVICE.
193  string codename = 10;
194
195  // Whether this device is virtual or physical.
196  DeviceForm form = 4;
197
198  // Whether this device is a phone, tablet, wearable, etc.
199  DeviceFormFactor form_factor = 16;
200
201  // Version-specific information of an Android model.
202  repeated PerAndroidVersionInfo per_version_info = 21;
203
204  // Screen size in the horizontal (X) dimension measured in pixels.
205  int32 screen_x = 5;
206
207  // Screen size in the vertical (Y) dimension measured in pixels.
208  int32 screen_y = 6;
209
210  // Screen density in DPI.
211  // This corresponds to ro.sf.lcd_density
212  int32 screen_density = 12;
213
214  // True if and only if tests with this model are recorded by stitching
215  // together screenshots. See use_low_spec_video_recording in device config.
216  bool low_fps_video_recording = 17;
217
218  // The set of Android versions this device supports.
219  repeated string supported_version_ids = 7;
220
221  // The list of supported ABIs for this device.
222  // This corresponds to either android.os.Build.SUPPORTED_ABIS (for API level
223  // 21 and above) or android.os.Build.CPU_ABI/CPU_ABI2.
224  // The most preferred ABI is the first element in the list.
225  //
226  // Elements are optionally prefixed by "version_id:" (where version_id is
227  // the id of an AndroidVersion), denoting an ABI that is supported only on
228  // a particular version.
229  repeated string supported_abis = 11;
230
231  // Tags for this dimension.
232  // Examples: "default", "preview", "deprecated".
233  repeated string tags = 8;
234
235  // URL of a thumbnail image (photo) of the device.
236  string thumbnail_url = 19;
237}
238
239// A version of the Android OS.
240message AndroidVersion {
241  // An opaque id for this Android version.
242  // Use this id to invoke the TestExecutionService.
243  string id = 1;
244
245  // A string representing this version of the Android OS.
246  // Examples: "4.3", "4.4".
247  string version_string = 2;
248
249  // The API level for this Android version.
250  // Examples: 18, 19.
251  int32 api_level = 3;
252
253  // The code name for this Android version.
254  // Examples: "JellyBean", "KitKat".
255  string code_name = 4;
256
257  // The date this Android version became available in the market.
258  google.type.Date release_date = 5;
259
260  // Market share for this version.
261  Distribution distribution = 6;
262
263  // Tags for this dimension.
264  // Examples: "default", "preview", "deprecated".
265  repeated string tags = 7;
266}
267
268// A version-specific information of an Android model.
269message PerAndroidVersionInfo {
270  // An Android version.
271  string version_id = 1;
272
273  // The number of online devices for an Android version.
274  DeviceCapacity device_capacity = 2;
275
276  // Output only. The estimated wait time for a single interactive device
277  // session using Direct Access.
278  google.protobuf.Duration interactive_device_availability_estimate = 3
279      [(google.api.field_behavior) = OUTPUT_ONLY];
280
281  // Output only. Identifies supported clients for DirectAccess for this Android
282  // version.
283  DirectAccessVersionInfo direct_access_version_info = 4
284      [(google.api.field_behavior) = OUTPUT_ONLY];
285}
286
287// Denotes whether Direct Access is supported, and by which client versions.
288//
289// DirectAccessService is currently available as a preview to select developers.
290// You can register today on behalf of you and your team at
291// https://developer.android.com/studio/preview/android-device-streaming
292message DirectAccessVersionInfo {
293  // Whether direct access is supported at all. Clients are expected to
294  // filter down the device list to only android models and versions which
295  // support Direct Access when that is the user intent.
296  bool direct_access_supported = 1;
297
298  // Output only. Indicates client-device compatibility, where a device is known
299  // to work only with certain workarounds implemented in the Android Studio
300  // client. Expected format "major.minor.micro.patch", e.g.
301  // "5921.22.2211.8881706".
302  string minimum_android_studio_version = 2;
303}
304
305// Data about the relative number of devices running a
306// given configuration of the Android platform.
307message Distribution {
308  // Output only. The time this distribution was measured.
309  google.protobuf.Timestamp measurement_time = 1;
310
311  // Output only. The estimated fraction (0-1) of the total market with this
312  // configuration.
313  double market_share = 2;
314}
315
316// The currently supported iOS devices.
317message IosDeviceCatalog {
318  // The set of supported iOS device models.
319  repeated IosModel models = 1;
320
321  // The set of supported iOS software versions.
322  repeated IosVersion versions = 2;
323
324  // The set of supported Xcode versions.
325  repeated XcodeVersion xcode_versions = 4;
326
327  // The set of supported runtime configurations.
328  IosRuntimeConfiguration runtime_configuration = 3;
329}
330
331// iOS configuration that can be selected at the time a test is run.
332message IosRuntimeConfiguration {
333  // The set of available locales.
334  repeated Locale locales = 1;
335
336  // The set of available orientations.
337  repeated Orientation orientations = 2;
338}
339
340// A description of an iOS device tests may be run on.
341message IosModel {
342  // The unique opaque id for this model.
343  // Use this for invoking the TestExecutionService.
344  string id = 1;
345
346  // The human-readable name for this device model.
347  // Examples: "iPhone 4s", "iPad Mini 2".
348  string name = 2;
349
350  // The set of iOS major software versions this device supports.
351  repeated string supported_version_ids = 3;
352
353  // Tags for this dimension.
354  // Examples: "default", "preview", "deprecated".
355  repeated string tags = 4;
356
357  // Device capabilities.
358  // Copied from
359  // https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html
360  repeated string device_capabilities = 5;
361
362  // Screen size in the horizontal (X) dimension measured in pixels.
363  int32 screen_x = 7;
364
365  // Screen size in the vertical (Y) dimension measured in pixels.
366  int32 screen_y = 8;
367
368  // Screen density in DPI.
369  int32 screen_density = 9;
370
371  // Whether this device is a phone, tablet, wearable, etc.
372  DeviceFormFactor form_factor = 6;
373
374  // Version-specific information of an iOS model.
375  repeated PerIosVersionInfo per_version_info = 14;
376}
377
378// An iOS version.
379message IosVersion {
380  // An opaque id for this iOS version.
381  // Use this id to invoke the TestExecutionService.
382  string id = 1;
383
384  // An integer representing the major iOS version.
385  // Examples: "8", "9".
386  int32 major_version = 2;
387
388  // An integer representing the minor iOS version.
389  // Examples: "1", "2".
390  int32 minor_version = 4;
391
392  // Tags for this dimension.
393  // Examples: "default", "preview", "deprecated".
394  repeated string tags = 3;
395
396  // The available Xcode versions for this version.
397  repeated string supported_xcode_version_ids = 5;
398}
399
400// A version-specific information of an iOS model.
401message PerIosVersionInfo {
402  // An iOS version.
403  string version_id = 1;
404
405  // The number of online devices for an iOS version.
406  DeviceCapacity device_capacity = 2;
407}
408
409// A location/region designation for language.
410message Locale {
411  // The id for this locale.
412  // Example: "en_US".
413  string id = 1;
414
415  // A human-friendly name for this language/locale.
416  // Example: "English".
417  string name = 2;
418
419  // A human-friendly string representing the region for this
420  // locale. Example: "United States". Not present for every locale.
421  string region = 3;
422
423  // Tags for this dimension.
424  // Example: "default".
425  repeated string tags = 4;
426}
427
428// Screen orientation of the device.
429message Orientation {
430  // The id for this orientation.
431  // Example: "portrait".
432  string id = 1;
433
434  // A human-friendly name for this orientation.
435  // Example: "portrait".
436  string name = 2;
437
438  // Tags for this dimension.
439  // Example: "default".
440  repeated string tags = 3;
441}
442
443// An Xcode version that an iOS version is compatible with.
444message XcodeVersion {
445  // The id for this version.
446  // Example: "9.2".
447  string version = 1;
448
449  // Tags for this Xcode version.
450  // Example: "default".
451  repeated string tags = 2;
452}
453
454message NetworkConfigurationCatalog {
455  repeated NetworkConfiguration configurations = 1;
456}
457
458message NetworkConfiguration {
459  // The unique opaque id for this network traffic configuration.
460  string id = 1;
461
462  // The emulation rule applying to the upload traffic.
463  TrafficRule up_rule = 2;
464
465  // The emulation rule applying to the download traffic.
466  TrafficRule down_rule = 3;
467}
468
469// Network emulation parameters.
470message TrafficRule {
471  // Packet delay, must be >= 0.
472  google.protobuf.Duration delay = 1;
473
474  // Packet loss ratio (0.0 - 1.0).
475  float packet_loss_ratio = 2;
476
477  // Packet duplication ratio (0.0 - 1.0).
478  float packet_duplication_ratio = 3;
479
480  // Bandwidth in kbits/second.
481  float bandwidth = 4;
482
483  // Burst size in kbits.
484  float burst = 5;
485}
486
487// The currently provided software environment on the devices under test.
488message ProvidedSoftwareCatalog {
489  // Deprecated: Use AndroidX Test Orchestrator going forward.
490  //
491  // A string representing the current version of Android Test Orchestrator
492  // that is used in the environment. The package is available at
493  // https://maven.google.com/web/index.html#com.android.support.test:orchestrator.
494  string orchestrator_version = 1 [deprecated = true];
495
496  // A string representing the current version of AndroidX Test Orchestrator
497  // that is used in the environment. The package is available at
498  // https://maven.google.com/web/index.html#androidx.test:orchestrator.
499  string androidx_orchestrator_version = 2;
500}
501
502// Whether the device is physical or virtual.
503enum DeviceForm {
504  // Do not use.  For proto versioning only.
505  DEVICE_FORM_UNSPECIFIED = 0;
506
507  // Android virtual device using Compute Engine native virtualization. Firebase
508  // Test Lab only.
509  VIRTUAL = 1;
510
511  // Actual hardware.
512  PHYSICAL = 2;
513
514  // Android virtual device using emulator in nested virtualization. Equivalent
515  // to Android Studio.
516  EMULATOR = 3;
517}
518
519// The form factor of a device.
520enum DeviceFormFactor {
521  // Do not use. For proto versioning only.
522  DEVICE_FORM_FACTOR_UNSPECIFIED = 0;
523
524  // This device has the shape of a phone.
525  PHONE = 1;
526
527  // This device has the shape of a tablet.
528  TABLET = 2;
529
530  // This device has the shape of a watch or other wearable.
531  WEARABLE = 3;
532}
533
534// Capacity based on the number of online devices in the lab.
535//
536// Important: device capacity does not directly reflect the length of the
537// queue at a moment in time. It does not take into account current traffic or
538// the state of the devices.
539//
540// For physical devices, the number is the average of online devices in the last
541// 30 days.
542enum DeviceCapacity {
543  // The value of device capacity is unknown or unset.
544  DEVICE_CAPACITY_UNSPECIFIED = 0;
545
546  // Devices that are high in capacity (The lab has a large number of these
547  // devices).
548  //
549  // These devices are generally suggested for running a large number of
550  // simultaneous tests (e.g. more than 100 tests).
551  //
552  // Please note that high capacity devices do not guarantee short wait times
553  // due to several factors:
554  // 1. Traffic (how heavily they are used at any given moment)
555  // 2. High capacity devices are prioritized for certain usages, which may
556  // cause user tests to be slower than selecting other similar device types.
557  DEVICE_CAPACITY_HIGH = 1;
558
559  // Devices that are medium in capacity (The lab has a decent number of these
560  // devices, though not as many as high capacity devices).
561  //
562  // These devices are suitable for fewer test runs (e.g. fewer than 100 tests)
563  // and only for low shard counts (e.g. less than 10 shards).
564  DEVICE_CAPACITY_MEDIUM = 2;
565
566  // Devices that are low in capacity (The lab has a small number of these
567  // devices).
568  //
569  // These devices may be used if users need to test on this specific device
570  // model and version. Please note that due to low capacity, the tests may take
571  // much longer to finish, especially if a large number of tests are invoked at
572  // once. These devices are not suitable for test sharding.
573  DEVICE_CAPACITY_LOW = 3;
574
575  // Devices that are completely missing from the lab.
576  //
577  // These devices are unavailable either temporarily or permanently and should
578  // not be requested. If the device is also marked as deprecated, this state
579  // is very likely permanent.
580  DEVICE_CAPACITY_NONE = 4;
581}
582