test_execution.proto 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269
  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/api/field_behavior.proto";
  18. import "google/protobuf/duration.proto";
  19. import "google/protobuf/timestamp.proto";
  20. import "google/api/client.proto";
  21. option go_package = "google.golang.org/genproto/googleapis/devtools/testing/v1;testing";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "TestExecutionProto";
  24. option java_package = "com.google.devtools.testing.v1";
  25. // A service for requesting test executions and querying their status.
  26. //
  27. // This service is part of Firebase Test Lab. To learn about how to use the
  28. // product, and how to integrate it with your system,
  29. // visit https://firebase.google.com/docs/test-lab.
  30. //
  31. // Each test execution will wait for available capacity. It will then be
  32. // invoked as described. The test may be invoked multiple times if an
  33. // infrastructure failure is detected. Results and other files generated by
  34. // the test will be stored in an external storage system.
  35. //
  36. // The TestExecutionService models this behavior using two resource types:
  37. //
  38. // - TestMatrix: a group of one or more TestExecutions, built by taking a
  39. // product of values over a pre-defined set of axes. In the case of Android
  40. // Tests, for example, device model and OS version are two axes of the matrix.
  41. //
  42. // - TestExecution: a single execution of one or more test targets on a
  43. // single device. These are created automatically when a TestMatrix is
  44. // created.
  45. //
  46. // This service returns any error codes from the canonical error space (i.e.
  47. // google.rpc.Code). The errors which may be returned are specified on each
  48. // method. In addition, any method may return UNAVAILABLE or INTERNAL.
  49. service TestExecutionService {
  50. option (google.api.default_host) = "testing.googleapis.com";
  51. option (google.api.oauth_scopes) =
  52. "https://www.googleapis.com/auth/cloud-platform,"
  53. "https://www.googleapis.com/auth/cloud-platform.read-only";
  54. // Creates and runs a matrix of tests according to the given specifications.
  55. // Unsupported environments will be returned in the state UNSUPPORTED.
  56. // A test matrix is limited to use at most 2000 devices in parallel.
  57. //
  58. // May return any of the following canonical error codes:
  59. //
  60. // - PERMISSION_DENIED - if the user is not authorized to write to project
  61. // - INVALID_ARGUMENT - if the request is malformed or if the matrix tries
  62. // to use too many simultaneous devices.
  63. rpc CreateTestMatrix(CreateTestMatrixRequest) returns (TestMatrix) {
  64. option (google.api.http) = {
  65. post: "/v1/projects/{project_id}/testMatrices"
  66. body: "test_matrix"
  67. };
  68. }
  69. // Checks the status of a test matrix.
  70. //
  71. // May return any of the following canonical error codes:
  72. //
  73. // - PERMISSION_DENIED - if the user is not authorized to read project
  74. // - INVALID_ARGUMENT - if the request is malformed
  75. // - NOT_FOUND - if the Test Matrix does not exist
  76. rpc GetTestMatrix(GetTestMatrixRequest) returns (TestMatrix) {
  77. option (google.api.http) = {
  78. get: "/v1/projects/{project_id}/testMatrices/{test_matrix_id}"
  79. };
  80. }
  81. // Cancels unfinished test executions in a test matrix.
  82. // This call returns immediately and cancellation proceeds asynchronously.
  83. // If the matrix is already final, this operation will have no effect.
  84. //
  85. // May return any of the following canonical error codes:
  86. //
  87. // - PERMISSION_DENIED - if the user is not authorized to read project
  88. // - INVALID_ARGUMENT - if the request is malformed
  89. // - NOT_FOUND - if the Test Matrix does not exist
  90. rpc CancelTestMatrix(CancelTestMatrixRequest) returns (CancelTestMatrixResponse) {
  91. option (google.api.http) = {
  92. post: "/v1/projects/{project_id}/testMatrices/{test_matrix_id}:cancel"
  93. };
  94. }
  95. }
  96. // TestMatrix captures all details about a test. It contains the environment
  97. // configuration, test specification, test executions and overall state and
  98. // outcome.
  99. message TestMatrix {
  100. // Output only. Unique id set by the service.
  101. string test_matrix_id = 1;
  102. // The cloud project that owns the test matrix.
  103. string project_id = 7;
  104. // Information about the client which invoked the test.
  105. ClientInfo client_info = 10;
  106. // Required. How to run the test.
  107. TestSpecification test_specification = 3;
  108. // Required. The devices the tests are being executed on.
  109. EnvironmentMatrix environment_matrix = 4;
  110. // Output only. The list of test executions that the service creates for
  111. // this matrix.
  112. repeated TestExecution test_executions = 5;
  113. // Required. Where the results for the matrix are written.
  114. ResultStorage result_storage = 6;
  115. // Output only. Indicates the current progress of the test matrix.
  116. TestState state = 8;
  117. // Output only. The time this test matrix was initially created.
  118. google.protobuf.Timestamp timestamp = 9;
  119. // Output only. Describes why the matrix is considered invalid.
  120. // Only useful for matrices in the INVALID state.
  121. InvalidMatrixDetails invalid_matrix_details = 11;
  122. // The number of times a TestExecution should be re-attempted if one or more
  123. // of its test cases fail for any reason.
  124. // The maximum number of reruns allowed is 10.
  125. //
  126. // Default is 0, which implies no reruns.
  127. int32 flaky_test_attempts = 13;
  128. // Output Only. The overall outcome of the test.
  129. // Only set when the test matrix state is FINISHED.
  130. OutcomeSummary outcome_summary = 14;
  131. // If true, only a single attempt at most will be made to run each
  132. // execution/shard in the matrix. Flaky test attempts are not affected.
  133. //
  134. // Normally, 2 or more attempts are made if a potential infrastructure issue
  135. // is detected.
  136. //
  137. // This feature is for latency sensitive workloads. The incidence of
  138. // execution failures may be significantly greater for fail-fast matrices
  139. // and support is more limited because of that expectation.
  140. bool fail_fast = 17;
  141. }
  142. // A single test executed in a single environment.
  143. message TestExecution {
  144. // Output only. Unique id set by the service.
  145. string id = 1;
  146. // Output only. Id of the containing TestMatrix.
  147. string matrix_id = 9;
  148. // Output only. The cloud project that owns the test execution.
  149. string project_id = 10;
  150. // Output only. How to run the test.
  151. TestSpecification test_specification = 3;
  152. // Output only. Details about the shard.
  153. Shard shard = 12;
  154. // Output only. How the host machine(s) are configured.
  155. Environment environment = 4;
  156. // Output only. Indicates the current progress of the test execution
  157. // (e.g., FINISHED).
  158. TestState state = 5;
  159. // Output only. Where the results for this execution are written.
  160. ToolResultsStep tool_results_step = 11;
  161. // Output only. The time this test execution was initially created.
  162. google.protobuf.Timestamp timestamp = 7;
  163. // Output only. Additional details about the running test.
  164. TestDetails test_details = 8;
  165. }
  166. // A description of how to run the test.
  167. message TestSpecification {
  168. // Max time a test execution is allowed to run before it is
  169. // automatically cancelled.
  170. // The default value is 5 min.
  171. google.protobuf.Duration test_timeout = 1;
  172. // Test setup requirements.
  173. oneof setup {
  174. // Test setup requirements for Android e.g. files to install, bootstrap
  175. // scripts.
  176. TestSetup test_setup = 6;
  177. // Test setup requirements for iOS.
  178. IosTestSetup ios_test_setup = 14;
  179. }
  180. // Required. The type of test to run.
  181. oneof test {
  182. // An Android instrumentation test.
  183. AndroidInstrumentationTest android_instrumentation_test = 2;
  184. // An Android robo test.
  185. AndroidRoboTest android_robo_test = 3;
  186. // An Android Application with a Test Loop.
  187. AndroidTestLoop android_test_loop = 9;
  188. // An iOS XCTest, via an .xctestrun file.
  189. IosXcTest ios_xc_test = 13;
  190. // An iOS application with a test loop.
  191. IosTestLoop ios_test_loop = 15;
  192. }
  193. // Disables video recording. May reduce test latency.
  194. bool disable_video_recording = 10;
  195. // Disables performance metrics recording. May reduce test latency.
  196. bool disable_performance_metrics = 11;
  197. }
  198. message SystraceSetup {
  199. // Systrace duration in seconds.
  200. // Should be between 1 and 30 seconds. 0 disables systrace.
  201. int32 duration_seconds = 1;
  202. }
  203. // A description of how to set up the Android device prior to running the test.
  204. message TestSetup {
  205. // List of files to push to the device before starting the test.
  206. repeated DeviceFile files_to_push = 1;
  207. // List of directories on the device to upload to GCS at the end of the test;
  208. // they must be absolute paths under /sdcard, /storage or /data/local/tmp.
  209. // Path names are restricted to characters a-z A-Z 0-9 _ - . + and /
  210. //
  211. // Note: The paths /sdcard and /data will be made available and treated as
  212. // implicit path substitutions. E.g. if /sdcard on a particular device does
  213. // not map to external storage, the system will replace it with the external
  214. // storage path prefix for that device.
  215. repeated string directories_to_pull = 2;
  216. // APKs to install in addition to those being directly tested.
  217. // Currently capped at 100.
  218. repeated Apk additional_apks = 3;
  219. // The device will be logged in on this account for the duration of the test.
  220. Account account = 4;
  221. // The network traffic profile used for running the test.
  222. // Available network profiles can be queried by using the
  223. // NETWORK_CONFIGURATION environment type when calling
  224. // TestEnvironmentDiscoveryService.GetTestEnvironmentCatalog.
  225. string network_profile = 5;
  226. // Environment variables to set for the test (only applicable for
  227. // instrumentation tests).
  228. repeated EnvironmentVariable environment_variables = 6;
  229. // Systrace configuration for the run.
  230. // If set a systrace will be taken, starting on test start and lasting for the
  231. // configured duration. The systrace file thus obtained is put in the results
  232. // bucket together with the other artifacts from the run.
  233. SystraceSetup systrace = 9;
  234. // Whether to prevent all runtime permissions to be granted at app install
  235. bool dont_autogrant_permissions = 23;
  236. }
  237. // A description of how to set up an iOS device prior to running the test.
  238. message IosTestSetup {
  239. // The network traffic profile used for running the test.
  240. // Available network profiles can be queried by using the
  241. // NETWORK_CONFIGURATION environment type when calling
  242. // TestEnvironmentDiscoveryService.GetTestEnvironmentCatalog.
  243. string network_profile = 1;
  244. // iOS apps to install in addition to those being directly tested.
  245. repeated FileReference additional_ipas = 2;
  246. // List of files to push to the device before starting the test.
  247. repeated IosDeviceFile push_files = 3;
  248. // List of directories on the device to upload to Cloud Storage at the end of
  249. // the test.
  250. //
  251. // Directories should either be in a shared directory
  252. // (e.g. /private/var/mobile/Media) or within an accessible directory inside
  253. // the app's filesystem (e.g. /Documents) by specifying the bundle id.
  254. repeated IosDeviceFile pull_directories = 4;
  255. }
  256. // A key-value pair passed as an environment variable to the test.
  257. message EnvironmentVariable {
  258. // Key for the environment variable.
  259. string key = 1;
  260. // Value for the environment variable.
  261. string value = 2;
  262. }
  263. // Identifies an account and how to log into it.
  264. message Account {
  265. // Required. The type of account, based what it's for (e.g. Google) and what
  266. // its login mechanism is (e.g. username and password).
  267. oneof account_type {
  268. // An automatic google login account.
  269. GoogleAuto google_auto = 1;
  270. }
  271. }
  272. // Enables automatic Google account login.
  273. // If set, the service automatically generates a Google test account and adds
  274. // it to the device, before executing the test. Note that test accounts might be
  275. // reused.
  276. // Many applications show their full set of functionalities when an account is
  277. // present on the device. Logging into the device with these generated accounts
  278. // allows testing more functionalities.
  279. message GoogleAuto {
  280. }
  281. // An Android package file to install.
  282. message Apk {
  283. // The path to an APK to be installed on the device before the test begins.
  284. FileReference location = 1;
  285. // The java package for the APK to be installed.
  286. // Value is determined by examining the application's manifest.
  287. string package_name = 2;
  288. }
  289. // An Android App Bundle file format, containing a BundleConfig.pb file,
  290. // a base module directory, zero or more dynamic feature module directories.
  291. // <p>See https://developer.android.com/guide/app-bundle/build for guidance on
  292. // building App Bundles.
  293. message AppBundle {
  294. // Required. Bundle location information.
  295. oneof bundle {
  296. // .aab file representing the app bundle under test.
  297. FileReference bundle_location = 1;
  298. }
  299. }
  300. // A single device file description.
  301. message DeviceFile {
  302. // Required.
  303. oneof device_file {
  304. // A reference to an opaque binary blob file.
  305. ObbFile obb_file = 1;
  306. // A reference to a regular file.
  307. RegularFile regular_file = 2;
  308. }
  309. }
  310. // An opaque binary blob file to install on the device before the test starts.
  311. message ObbFile {
  312. // Required. OBB file name which must conform to the format as specified by
  313. // Android
  314. // e.g. [main|patch].0300110.com.example.android.obb
  315. // which will be installed into
  316. // \<shared-storage\>/Android/obb/\<package-name\>/
  317. // on the device.
  318. string obb_file_name = 1;
  319. // Required. Opaque Binary Blob (OBB) file(s) to install on the device.
  320. FileReference obb = 2;
  321. }
  322. // A file or directory to install on the device before the test starts.
  323. message RegularFile {
  324. // Required. The source file.
  325. FileReference content = 1;
  326. // Required. Where to put the content on the device. Must be an absolute,
  327. // allowlisted path. If the file exists, it will be replaced.
  328. // The following device-side directories and any of their subdirectories are
  329. // allowlisted:
  330. // <p>${EXTERNAL_STORAGE}, /sdcard, or /storage</p>
  331. // <p>${ANDROID_DATA}/local/tmp, or /data/local/tmp</p>
  332. // <p>Specifying a path outside of these directory trees is invalid.
  333. //
  334. // <p> The paths /sdcard and /data will be made available and treated as
  335. // implicit path substitutions. E.g. if /sdcard on a particular device does
  336. // not map to external storage, the system will replace it with the external
  337. // storage path prefix for that device and copy the file there.
  338. //
  339. // <p> It is strongly advised to use the <a href=
  340. // "http://developer.android.com/reference/android/os/Environment.html">
  341. // Environment API</a> in app and test code to access files on the device in a
  342. // portable way.
  343. string device_path = 2;
  344. }
  345. // A file or directory to install on the device before the test starts.
  346. message IosDeviceFile {
  347. // The source file
  348. FileReference content = 1;
  349. // The bundle id of the app where this file lives.
  350. //
  351. // iOS apps sandbox their own filesystem, so app files must specify which app
  352. // installed on the device.
  353. string bundle_id = 2;
  354. // Location of the file on the device, inside the app's sandboxed filesystem
  355. string device_path = 3;
  356. }
  357. // A test of an Android Application with a Test Loop.
  358. // The intent \<intent-name\> will be implicitly added, since Games is the only
  359. // user of this api, for the time being.
  360. message AndroidTestLoop {
  361. // Required. The Android package to test.
  362. oneof app_under_test {
  363. // The APK for the application under test.
  364. FileReference app_apk = 1;
  365. // A multi-apk app bundle for the application under test.
  366. AppBundle app_bundle = 5;
  367. }
  368. // The java package for the application under test.
  369. // The default is determined by examining the application's manifest.
  370. string app_package_id = 2;
  371. // The list of scenarios that should be run during the test.
  372. // The default is all test loops, derived from the application's
  373. // manifest.
  374. repeated int32 scenarios = 3;
  375. // The list of scenario labels that should be run during the test.
  376. // The scenario labels should map to labels defined in the application's
  377. // manifest. For example, player_experience and
  378. // com.google.test.loops.player_experience add all of the loops labeled in the
  379. // manifest with the com.google.test.loops.player_experience name to the
  380. // execution.
  381. // Scenarios can also be specified in the scenarios field.
  382. repeated string scenario_labels = 4;
  383. }
  384. // A test of an iOS application that uses the XCTest framework.
  385. // Xcode supports the option to "build for testing", which generates an
  386. // .xctestrun file that contains a test specification (arguments, test methods,
  387. // etc). This test type accepts a zip file containing the .xctestrun file and
  388. // the corresponding contents of the Build/Products directory that contains all
  389. // the binaries needed to run the tests.
  390. message IosXcTest {
  391. // Required. The .zip containing the .xctestrun file and the contents of the
  392. // DerivedData/Build/Products directory.
  393. // The .xctestrun file in this zip is ignored if the xctestrun field is
  394. // specified.
  395. FileReference tests_zip = 1;
  396. // An .xctestrun file that will override the .xctestrun file in the
  397. // tests zip. Because the .xctestrun file contains environment variables along
  398. // with test methods to run and/or ignore, this can be useful for sharding
  399. // tests. Default is taken from the tests zip.
  400. FileReference xctestrun = 2;
  401. // The Xcode version that should be used for the test.
  402. // Use the TestEnvironmentDiscoveryService to get supported options.
  403. // Defaults to the latest Xcode version Firebase Test Lab supports.
  404. string xcode_version = 3;
  405. // Output only. The bundle id for the application under test.
  406. string app_bundle_id = 4;
  407. // The option to test special app entitlements. Setting this would re-sign the
  408. // app having special entitlements with an explicit application-identifier.
  409. // Currently supports testing aps-environment entitlement.
  410. bool test_special_entitlements = 6;
  411. }
  412. // A test of an iOS application that implements one or more game loop scenarios.
  413. // This test type accepts an archived application (.ipa file) and a list of
  414. // integer scenarios that will be executed on the app sequentially.
  415. message IosTestLoop {
  416. // Required. The .ipa of the application to test.
  417. FileReference app_ipa = 1;
  418. // The list of scenarios that should be run during the test. Defaults to the
  419. // single scenario 0 if unspecified.
  420. repeated int32 scenarios = 2;
  421. // Output only. The bundle id for the application under test.
  422. string app_bundle_id = 3;
  423. }
  424. // A test of an Android application that can control an Android component
  425. // independently of its normal lifecycle.
  426. // Android instrumentation tests run an application APK and test APK inside the
  427. // same process on a virtual or physical AndroidDevice. They also specify
  428. // a test runner class, such as com.google.GoogleTestRunner, which can vary
  429. // on the specific instrumentation framework chosen.
  430. //
  431. // See <http://developer.android.com/tools/testing/testing_android.html> for
  432. // more information on types of Android tests.
  433. message AndroidInstrumentationTest {
  434. // Required.
  435. oneof app_under_test {
  436. // The APK for the application under test.
  437. FileReference app_apk = 1;
  438. // A multi-apk app bundle for the application under test.
  439. AppBundle app_bundle = 8;
  440. }
  441. // Required. The APK containing the test code to be executed.
  442. FileReference test_apk = 2;
  443. // The java package for the application under test.
  444. // The default value is determined by examining the application's manifest.
  445. string app_package_id = 3;
  446. // The java package for the test to be executed.
  447. // The default value is determined by examining the application's manifest.
  448. string test_package_id = 4;
  449. // The InstrumentationTestRunner class.
  450. // The default value is determined by examining the application's manifest.
  451. string test_runner_class = 5;
  452. // Each target must be fully qualified with the package name or class name,
  453. // in one of these formats:
  454. // - "package package_name"
  455. // - "class package_name.class_name"
  456. // - "class package_name.class_name#method_name"
  457. //
  458. // If empty, all targets in the module will be run.
  459. repeated string test_targets = 6;
  460. // The option of whether running each test within its own invocation of
  461. // instrumentation with Android Test Orchestrator or not.
  462. // ** Orchestrator is only compatible with AndroidJUnitRunner version 1.0 or
  463. // higher! **
  464. // Orchestrator offers the following benefits:
  465. // - No shared state
  466. // - Crashes are isolated
  467. // - Logs are scoped per test
  468. //
  469. // See
  470. // <https://developer.android.com/training/testing/junit-runner.html#using-android-test-orchestrator>
  471. // for more information about Android Test Orchestrator.
  472. //
  473. // If not set, the test will be run without the orchestrator.
  474. OrchestratorOption orchestrator_option = 7;
  475. // The option to run tests in multiple shards in parallel.
  476. ShardingOption sharding_option = 9;
  477. }
  478. // A test of an android application that explores the application on a virtual
  479. // or physical Android Device, finding culprits and crashes as it goes.
  480. // Next tag: 30
  481. message AndroidRoboTest {
  482. // Required.
  483. oneof app_under_test {
  484. // The APK for the application under test.
  485. FileReference app_apk = 1;
  486. // A multi-apk app bundle for the application under test.
  487. AppBundle app_bundle = 16;
  488. }
  489. // The java package for the application under test.
  490. // The default value is determined by examining the application's manifest.
  491. string app_package_id = 2;
  492. // The initial activity that should be used to start the app.
  493. string app_initial_activity = 3;
  494. // The max depth of the traversal stack Robo can explore. Needs to be at least
  495. // 2 to make Robo explore the app beyond the first activity.
  496. // Default is 50.
  497. int32 max_depth = 7 [deprecated = true];
  498. // The max number of steps Robo can execute.
  499. // Default is no limit.
  500. int32 max_steps = 8 [deprecated = true];
  501. // A set of directives Robo should apply during the crawl.
  502. // This allows users to customize the crawl. For example, the username and
  503. // password for a test account can be provided.
  504. repeated RoboDirective robo_directives = 11;
  505. // A JSON file with a sequence of actions Robo should perform as a prologue
  506. // for the crawl.
  507. FileReference robo_script = 13;
  508. // The intents used to launch the app for the crawl.
  509. // If none are provided, then the main launcher activity is launched.
  510. // If some are provided, then only those provided are launched (the main
  511. // launcher activity must be provided explicitly).
  512. repeated RoboStartingIntent starting_intents = 15;
  513. }
  514. // Directs Robo to interact with a specific UI element if it is encountered
  515. // during the crawl. Currently, Robo can perform text entry or element click.
  516. message RoboDirective {
  517. // Required. The android resource name of the target UI element.
  518. // For example,
  519. // in Java: R.string.foo
  520. // in xml: @string/foo
  521. // Only the "foo" part is needed.
  522. // Reference doc:
  523. // https://developer.android.com/guide/topics/resources/accessing-resources.html
  524. string resource_name = 1;
  525. // The text that Robo is directed to set. If left empty, the directive will be
  526. // treated as a CLICK on the element matching the resource_name.
  527. string input_text = 2;
  528. // Required. The type of action that Robo should perform on the specified
  529. // element.
  530. RoboActionType action_type = 3;
  531. }
  532. // Message for specifying the start activities to crawl.
  533. message RoboStartingIntent {
  534. // Required. Intent details to start an activity.
  535. oneof starting_intent {
  536. // An intent that starts the main launcher activity.
  537. LauncherActivityIntent launcher_activity = 1;
  538. // An intent that starts an activity with specific details.
  539. StartActivityIntent start_activity = 2;
  540. }
  541. // Timeout in seconds for each intent.
  542. google.protobuf.Duration timeout = 3;
  543. }
  544. // Specifies an intent that starts the main launcher activity.
  545. message LauncherActivityIntent {
  546. }
  547. // A starting intent specified by an action, uri, and categories.
  548. message StartActivityIntent {
  549. // Action name.
  550. // Required for START_ACTIVITY.
  551. string action = 2;
  552. // URI for the action.
  553. string uri = 3;
  554. // Intent categories to set on the intent.
  555. repeated string categories = 4;
  556. }
  557. // The matrix of environments in which the test is to be executed.
  558. message EnvironmentMatrix {
  559. // Required. The environment matrix.
  560. oneof environment_matrix {
  561. // A matrix of Android devices.
  562. AndroidMatrix android_matrix = 1;
  563. // A list of Android devices; the test will be run only on the specified
  564. // devices.
  565. AndroidDeviceList android_device_list = 2;
  566. // A list of iOS devices.
  567. IosDeviceList ios_device_list = 3;
  568. }
  569. }
  570. // A list of Android device configurations in which the test is to be executed.
  571. message AndroidDeviceList {
  572. // Required. A list of Android devices.
  573. repeated AndroidDevice android_devices = 1;
  574. }
  575. // Specifies how to execute the test.
  576. enum OrchestratorOption {
  577. // Default value: the server will choose the mode. Currently implies that
  578. // the test will run without the orchestrator. In the future,
  579. // all instrumentation tests will be run with the orchestrator.
  580. // Using the orchestrator is highly encouraged because of all the benefits it
  581. // offers.
  582. ORCHESTRATOR_OPTION_UNSPECIFIED = 0;
  583. // Run test using orchestrator.
  584. // ** Only compatible with AndroidJUnitRunner version 1.0 or higher! **
  585. // Recommended.
  586. USE_ORCHESTRATOR = 1;
  587. // Run test without using orchestrator.
  588. DO_NOT_USE_ORCHESTRATOR = 2;
  589. }
  590. // A list of iOS device configurations in which the test is to be executed.
  591. message IosDeviceList {
  592. // Required. A list of iOS devices.
  593. repeated IosDevice ios_devices = 1;
  594. }
  595. // A set of Android device configuration permutations is defined by the
  596. // the cross-product of the given axes. Internally, the given AndroidMatrix
  597. // will be expanded into a set of AndroidDevices.
  598. //
  599. // Only supported permutations will be instantiated. Invalid permutations
  600. // (e.g., incompatible models/versions) are ignored.
  601. message AndroidMatrix {
  602. // Required. The ids of the set of Android device to be used.
  603. // Use the TestEnvironmentDiscoveryService to get supported options.
  604. repeated string android_model_ids = 1;
  605. // Required. The ids of the set of Android OS version to be used.
  606. // Use the TestEnvironmentDiscoveryService to get supported options.
  607. repeated string android_version_ids = 2;
  608. // Required. The set of locales the test device will enable for testing.
  609. // Use the TestEnvironmentDiscoveryService to get supported options.
  610. repeated string locales = 3;
  611. // Required. The set of orientations to test with.
  612. // Use the TestEnvironmentDiscoveryService to get supported options.
  613. repeated string orientations = 4;
  614. }
  615. // Information about the client which invoked the test.
  616. message ClientInfo {
  617. // Required. Client name, such as gcloud.
  618. string name = 1;
  619. // The list of detailed information about client.
  620. repeated ClientInfoDetail client_info_details = 2;
  621. }
  622. // Key-value pair of detailed information about the client which invoked the
  623. // test. Examples: {'Version', '1.0'}, {'Release Track', 'BETA'}.
  624. message ClientInfoDetail {
  625. // Required. The key of detailed client information.
  626. string key = 1;
  627. // Required. The value of detailed client information.
  628. string value = 2;
  629. }
  630. // Locations where the results of running the test are stored.
  631. message ResultStorage {
  632. // Required.
  633. GoogleCloudStorage google_cloud_storage = 1;
  634. // The tool results history that contains the tool results execution that
  635. // results are written to.
  636. //
  637. // If not provided, the service will choose an appropriate value.
  638. ToolResultsHistory tool_results_history = 5;
  639. // Output only. The tool results execution that results are written to.
  640. ToolResultsExecution tool_results_execution = 6;
  641. // Output only. URL to the results in the Firebase Web Console.
  642. string results_url = 7;
  643. }
  644. // Represents a tool results history resource.
  645. message ToolResultsHistory {
  646. // Required. The cloud project that owns the tool results history.
  647. string project_id = 1;
  648. // Required. A tool results history ID.
  649. string history_id = 2;
  650. }
  651. // Represents a tool results execution resource.
  652. //
  653. // This has the results of a TestMatrix.
  654. message ToolResultsExecution {
  655. // Output only. The cloud project that owns the tool results execution.
  656. string project_id = 1;
  657. // Output only. A tool results history ID.
  658. string history_id = 2;
  659. // Output only. A tool results execution ID.
  660. string execution_id = 3;
  661. }
  662. // Represents a tool results step resource.
  663. //
  664. // This has the results of a TestExecution.
  665. message ToolResultsStep {
  666. // Output only. The cloud project that owns the tool results step.
  667. string project_id = 1;
  668. // Output only. A tool results history ID.
  669. string history_id = 2;
  670. // Output only. A tool results execution ID.
  671. string execution_id = 3;
  672. // Output only. A tool results step ID.
  673. string step_id = 4;
  674. }
  675. // A storage location within Google cloud storage (GCS).
  676. message GoogleCloudStorage {
  677. // Required. The path to a directory in GCS that will
  678. // eventually contain the results for this test.
  679. // The requesting user must have write access on the bucket in the supplied
  680. // path.
  681. string gcs_path = 1;
  682. }
  683. // Actions which Robo can perform on UI elements.
  684. enum RoboActionType {
  685. // DO NOT USE. For proto versioning only.
  686. ACTION_TYPE_UNSPECIFIED = 0;
  687. // Direct Robo to click on the specified element. No-op if specified element
  688. // is not clickable.
  689. SINGLE_CLICK = 1;
  690. // Direct Robo to enter text on the specified element. No-op if specified
  691. // element is not enabled or does not allow text entry.
  692. ENTER_TEXT = 2;
  693. // Direct Robo to ignore interactions with a specific element.
  694. IGNORE = 3;
  695. }
  696. // A reference to a file, used for user inputs.
  697. message FileReference {
  698. // Required. The file reference.
  699. oneof file {
  700. // A path to a file in Google Cloud Storage.
  701. // Example: gs://build-app-1414623860166/app%40debug-unaligned.apk
  702. // These paths are expected to be url encoded (percent encoding)
  703. string gcs_path = 1;
  704. }
  705. }
  706. // The environment in which the test is run.
  707. message Environment {
  708. // Required. The environment.
  709. oneof environment {
  710. // An Android device which must be used with an Android test.
  711. AndroidDevice android_device = 1;
  712. // An iOS device which must be used with an iOS test.
  713. IosDevice ios_device = 2;
  714. }
  715. }
  716. // A single Android device.
  717. message AndroidDevice {
  718. // Required. The id of the Android device to be used.
  719. // Use the TestEnvironmentDiscoveryService to get supported options.
  720. string android_model_id = 1;
  721. // Required. The id of the Android OS version to be used.
  722. // Use the TestEnvironmentDiscoveryService to get supported options.
  723. string android_version_id = 2;
  724. // Required. The locale the test device used for testing.
  725. // Use the TestEnvironmentDiscoveryService to get supported options.
  726. string locale = 3;
  727. // Required. How the device is oriented during the test.
  728. // Use the TestEnvironmentDiscoveryService to get supported options.
  729. string orientation = 4;
  730. }
  731. // A single iOS device.
  732. message IosDevice {
  733. // Required. The id of the iOS device to be used.
  734. // Use the TestEnvironmentDiscoveryService to get supported options.
  735. string ios_model_id = 1;
  736. // Required. The id of the iOS major software version to be used.
  737. // Use the TestEnvironmentDiscoveryService to get supported options.
  738. string ios_version_id = 2;
  739. // Required. The locale the test device used for testing.
  740. // Use the TestEnvironmentDiscoveryService to get supported options.
  741. string locale = 3;
  742. // Required. How the device is oriented during the test.
  743. // Use the TestEnvironmentDiscoveryService to get supported options.
  744. string orientation = 4;
  745. }
  746. // Additional details about the progress of the running test.
  747. message TestDetails {
  748. // Output only. Human-readable, detailed descriptions of the test's progress.
  749. // For example: "Provisioning a device", "Starting Test".
  750. //
  751. // During the course of execution new data may be appended
  752. // to the end of progress_messages.
  753. repeated string progress_messages = 3;
  754. // Output only. If the TestState is ERROR, then this string will contain
  755. // human-readable details about the error.
  756. string error_message = 4;
  757. }
  758. // Details behind an invalid request.
  759. message InvalidRequestDetail {
  760. // Possible invalid request reasons.
  761. enum Reason {
  762. // No reason has been specified - the default.
  763. REASON_UNSPECIFIED = 0;
  764. // The request is not valid.
  765. REQUEST_INVALID = 1;
  766. // One or more of the resources specified in the request is too large.
  767. RESOURCE_TOO_BIG = 2;
  768. // One or more resources specified in the request cannot be found.
  769. RESOURCE_NOT_FOUND = 3;
  770. // This request is not (currently) supported.
  771. UNSUPPORTED = 4;
  772. // This request is not currently implemented.
  773. NOT_IMPLEMENTED = 5;
  774. }
  775. // The reason behind the error.
  776. Reason reason = 1;
  777. }
  778. // Options for enabling sharding.
  779. message ShardingOption {
  780. oneof option {
  781. // Uniformly shards test cases given a total number of shards.
  782. UniformSharding uniform_sharding = 1;
  783. // Shards test cases into the specified groups of packages, classes, and/or
  784. // methods.
  785. ManualSharding manual_sharding = 2;
  786. }
  787. }
  788. // Uniformly shards test cases given a total number of shards.
  789. //
  790. // For Instrumentation test, it will be translated to "-e numShard" "-e
  791. // shardIndex" AndroidJUnitRunner arguments. With uniform sharding enabled,
  792. // specifying these sharding arguments via environment_variables is invalid.
  793. message UniformSharding {
  794. // Required. Total number of shards. When any physical devices are selected,
  795. // the number must be >= 1 and <= 50. When no physical devices are selected,
  796. // the number must be >= 1 and <= 500.
  797. int32 num_shards = 1;
  798. }
  799. // Shards test cases into the specified groups of packages, classes, and/or
  800. // methods.
  801. //
  802. // With manual sharding enabled, specifying test targets via
  803. // environment_variables or in InstrumentationTest is invalid.
  804. message ManualSharding {
  805. // Required. Group of packages, classes, and/or test methods to be run for
  806. // each shard. When any physical devices are selected, the number of
  807. // test_targets_for_shard must be >= 1 and <= 50. When no physical devices are
  808. // selected, the number must be >= 1 and <= 500.
  809. repeated TestTargetsForShard test_targets_for_shard = 1;
  810. }
  811. // Test targets for a shard.
  812. message TestTargetsForShard {
  813. // Group of packages, classes, and/or test methods to be run for each shard.
  814. // The targets need to be specified in AndroidJUnitRunner argument format. For
  815. // example, "package com.my.packages" "class com.my.package.MyClass".
  816. //
  817. // The number of shard_test_targets must be greater than 0.
  818. repeated string test_targets = 1;
  819. }
  820. // Output only. Details about the shard.
  821. message Shard {
  822. // Output only. The index of the shard among all the shards.
  823. int32 shard_index = 1;
  824. // Output only. The total number of shards.
  825. int32 num_shards = 2;
  826. // Output only. Test targets for each shard.
  827. TestTargetsForShard test_targets_for_shard = 3;
  828. }
  829. // Request to submit a matrix of tests for execution.
  830. message CreateTestMatrixRequest {
  831. // The GCE project under which this job will run.
  832. string project_id = 1;
  833. // The matrix of tests that the user wants to run.
  834. TestMatrix test_matrix = 2;
  835. // A string id used to detect duplicated requests.
  836. // Ids are automatically scoped to a project, so
  837. // users should ensure the ID is unique per-project.
  838. // A UUID is recommended.
  839. //
  840. // Optional, but strongly recommended.
  841. string request_id = 3;
  842. }
  843. // Request to get the Test Matrix with the given id.
  844. message GetTestMatrixRequest {
  845. // Cloud project that owns the test matrix.
  846. string project_id = 1;
  847. // Unique test matrix id which was assigned by the service.
  848. string test_matrix_id = 2;
  849. }
  850. // Request to stop running all of the tests in the specified matrix.
  851. message CancelTestMatrixRequest {
  852. // Cloud project that owns the test.
  853. string project_id = 1;
  854. // Test matrix that will be canceled.
  855. string test_matrix_id = 2;
  856. }
  857. // Response containing the current state of the specified test matrix.
  858. message CancelTestMatrixResponse {
  859. // The current rolled-up state of the test matrix.
  860. // If this state is already final, then the cancelation request will
  861. // have no effect.
  862. TestState test_state = 1;
  863. }
  864. // The detailed reason that a Matrix was deemed INVALID.
  865. enum InvalidMatrixDetails {
  866. // Do not use. For proto versioning only.
  867. INVALID_MATRIX_DETAILS_UNSPECIFIED = 0;
  868. // The matrix is INVALID, but there are no further details available.
  869. DETAILS_UNAVAILABLE = 1;
  870. // The input app APK could not be parsed.
  871. MALFORMED_APK = 2;
  872. // The input test APK could not be parsed.
  873. MALFORMED_TEST_APK = 3;
  874. // The AndroidManifest.xml could not be found.
  875. NO_MANIFEST = 4;
  876. // The APK manifest does not declare a package name.
  877. NO_PACKAGE_NAME = 5;
  878. // The APK application ID (aka package name) is invalid.
  879. // See also
  880. // https://developer.android.com/studio/build/application-id
  881. INVALID_PACKAGE_NAME = 31;
  882. // The test package and app package are the same.
  883. TEST_SAME_AS_APP = 6;
  884. // The test apk does not declare an instrumentation.
  885. NO_INSTRUMENTATION = 7;
  886. // The input app apk does not have a signature.
  887. NO_SIGNATURE = 20;
  888. // The test runner class specified by user or in the test APK's manifest file
  889. // is not compatible with Android Test Orchestrator.
  890. // Orchestrator is only compatible with AndroidJUnitRunner version 1.0 or
  891. // higher.
  892. // Orchestrator can be disabled by using DO_NOT_USE_ORCHESTRATOR
  893. // OrchestratorOption.
  894. INSTRUMENTATION_ORCHESTRATOR_INCOMPATIBLE = 18;
  895. // The test APK does not contain the test runner class specified by user or in
  896. // the manifest file.
  897. // This can be caused by either of the following reasons:
  898. // - the user provided a runner class name that's incorrect, or
  899. // - the test runner isn't built into the test APK (might be in the app APK
  900. // instead).
  901. NO_TEST_RUNNER_CLASS = 19;
  902. // A main launcher activity could not be found.
  903. NO_LAUNCHER_ACTIVITY = 8;
  904. // The app declares one or more permissions that are not allowed.
  905. FORBIDDEN_PERMISSIONS = 9;
  906. // There is a conflict in the provided robo_directives.
  907. INVALID_ROBO_DIRECTIVES = 10;
  908. // There is at least one invalid resource name in the provided
  909. // robo directives
  910. INVALID_RESOURCE_NAME = 33;
  911. // Invalid definition of action in the robo directives
  912. // (e.g. a click or ignore action includes an input text field)
  913. INVALID_DIRECTIVE_ACTION = 34;
  914. // There is no test loop intent filter, or the one that is given is
  915. // not formatted correctly.
  916. TEST_LOOP_INTENT_FILTER_NOT_FOUND = 12;
  917. // The request contains a scenario label that was not declared in the
  918. // manifest.
  919. SCENARIO_LABEL_NOT_DECLARED = 13;
  920. // There was an error when parsing a label's value.
  921. SCENARIO_LABEL_MALFORMED = 14;
  922. // The request contains a scenario number that was not declared in the
  923. // manifest.
  924. SCENARIO_NOT_DECLARED = 15;
  925. // Device administrator applications are not allowed.
  926. DEVICE_ADMIN_RECEIVER = 17;
  927. // The zipped XCTest was malformed. The zip did not contain a single
  928. // .xctestrun file and the contents of the DerivedData/Build/Products
  929. // directory.
  930. MALFORMED_XC_TEST_ZIP = 11;
  931. // The zipped XCTest was built for the iOS simulator rather than for a
  932. // physical device.
  933. BUILT_FOR_IOS_SIMULATOR = 24;
  934. // The .xctestrun file did not specify any test targets.
  935. NO_TESTS_IN_XC_TEST_ZIP = 25;
  936. // One or more of the test targets defined in the .xctestrun file specifies
  937. // "UseDestinationArtifacts", which is disallowed.
  938. USE_DESTINATION_ARTIFACTS = 26;
  939. // XC tests which run on physical devices must have
  940. // "IsAppHostedTestBundle" == "true" in the xctestrun file.
  941. TEST_NOT_APP_HOSTED = 28;
  942. // An Info.plist file in the XCTest zip could not be parsed.
  943. PLIST_CANNOT_BE_PARSED = 30;
  944. // The APK is marked as "testOnly".
  945. // Deprecated and not currently used.
  946. TEST_ONLY_APK = 21 [deprecated = true];
  947. // The input IPA could not be parsed.
  948. MALFORMED_IPA = 22;
  949. // The application doesn't register the game loop URL scheme.
  950. MISSING_URL_SCHEME = 35;
  951. // The iOS application bundle (.app) couldn't be processed.
  952. MALFORMED_APP_BUNDLE = 36;
  953. // APK contains no code.
  954. // See also
  955. // https://developer.android.com/guide/topics/manifest/application-element.html#code
  956. NO_CODE_APK = 23;
  957. // Either the provided input APK path was malformed,
  958. // the APK file does not exist, or the user does not have permission to
  959. // access the APK file.
  960. INVALID_INPUT_APK = 27;
  961. // APK is built for a preview SDK which is unsupported
  962. INVALID_APK_PREVIEW_SDK = 29;
  963. }
  964. // The state (i.e., progress) of a test execution or matrix.
  965. enum TestState {
  966. // Do not use. For proto versioning only.
  967. TEST_STATE_UNSPECIFIED = 0;
  968. // The execution or matrix is being validated.
  969. VALIDATING = 8;
  970. // The execution or matrix is waiting for resources to become available.
  971. PENDING = 1;
  972. // The execution is currently being processed.
  973. //
  974. // Can only be set on an execution.
  975. RUNNING = 2;
  976. // The execution or matrix has terminated normally.
  977. //
  978. // On a matrix this means that the matrix level processing completed normally,
  979. // but individual executions may be in an ERROR state.
  980. FINISHED = 3;
  981. // The execution or matrix has stopped because it encountered an
  982. // infrastructure failure.
  983. ERROR = 4;
  984. // The execution was not run because it corresponds to a unsupported
  985. // environment.
  986. //
  987. // Can only be set on an execution.
  988. UNSUPPORTED_ENVIRONMENT = 5;
  989. // The execution was not run because the provided inputs are incompatible with
  990. // the requested environment.
  991. //
  992. // Example: requested AndroidVersion is lower than APK's minSdkVersion
  993. //
  994. // Can only be set on an execution.
  995. INCOMPATIBLE_ENVIRONMENT = 9;
  996. // The execution was not run because the provided inputs are incompatible with
  997. // the requested architecture.
  998. //
  999. // Example: requested device does not support running the native code in
  1000. // the supplied APK
  1001. //
  1002. // Can only be set on an execution.
  1003. INCOMPATIBLE_ARCHITECTURE = 10;
  1004. // The user cancelled the execution.
  1005. //
  1006. // Can only be set on an execution.
  1007. CANCELLED = 6;
  1008. // The execution or matrix was not run because the provided inputs are not
  1009. // valid.
  1010. //
  1011. // Examples: input file is not of the expected type, is malformed/corrupt, or
  1012. // was flagged as malware
  1013. INVALID = 7;
  1014. }
  1015. // Outcome summary for a finished test matrix.
  1016. enum OutcomeSummary {
  1017. // Do not use. For proto versioning only.
  1018. OUTCOME_SUMMARY_UNSPECIFIED = 0;
  1019. // The test matrix run was successful, for instance:
  1020. // - All the test cases passed.
  1021. // - Robo did not detect a crash of the application under test.
  1022. SUCCESS = 1;
  1023. // A run failed, for instance:
  1024. // - One or more test case failed.
  1025. // - A test timed out.
  1026. // - The application under test crashed.
  1027. FAILURE = 2;
  1028. // Something unexpected happened. The run should still be considered
  1029. // unsuccessful but this is likely a transient problem and re-running the
  1030. // test might be successful.
  1031. INCONCLUSIVE = 3;
  1032. // All tests were skipped, for instance:
  1033. // - All device configurations were incompatible.
  1034. SKIPPED = 4;
  1035. }