test_execution.proto 43 KB

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