Julien Desprez | 093c3f6 | 2018-05-21 16:23:37 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | syntax = "proto3"; |
| 17 | |
| 18 | import "google/protobuf/any.proto"; |
| 19 | import "google/protobuf/timestamp.proto"; |
| 20 | import "tools/tradefederation/core/proto/metric_measurement.proto"; |
| 21 | |
Julien Desprez | ed8bd9b | 2018-07-13 08:50:20 -0700 | [diff] [blame] | 22 | option java_package = "com.android.tradefed.result.proto"; |
Julien Desprez | 093c3f6 | 2018-05-21 16:23:37 -0700 | [diff] [blame] | 23 | option java_outer_classname = "TestRecordProto"; |
| 24 | |
| 25 | package android_test_record; |
| 26 | |
| 27 | // A record containing the status, logs, and other information associated with a |
| 28 | // particular test execution. |
| 29 | message TestRecord { |
| 30 | // The UUID of this TestRecord. |
| 31 | string test_record_id = 1; |
| 32 | |
| 33 | // The UUID of this TestRecord's parent. Unset if this is a top-level record. |
| 34 | string parent_test_record_id = 2; |
| 35 | |
| 36 | // References to any finer-grained TestRecords that were generated as part of |
| 37 | // this test. |
| 38 | repeated ChildReference children = 3; |
| 39 | |
| 40 | // The number of children this TestRecord was expected to have. Unset if not |
| 41 | // known in advance. |
| 42 | int64 num_expected_children = 4; |
| 43 | |
| 44 | // The result status (Pass, Fail, etc) of this test unit. |
| 45 | TestStatus status = 5; |
| 46 | |
| 47 | // Extra debugging information. |
| 48 | DebugInfo debug_info = 6; |
| 49 | |
| 50 | // The time at which this test started executing. |
| 51 | google.protobuf.Timestamp start_time = 7; |
| 52 | |
| 53 | // The time at which this test finished executing. |
| 54 | google.protobuf.Timestamp end_time = 8; |
| 55 | |
| 56 | // Any artifact files associated with this test. |
| 57 | map<string, google.protobuf.Any> artifacts = 9; |
| 58 | |
| 59 | // Any metrics or measurements associated with this test. |
| 60 | map<string, tradefed.metric.Metric> metrics = 10; |
| 61 | |
| 62 | // Metadata describing the test that was run. |
| 63 | google.protobuf.Any description = 11; |
Julien Desprez | b18ff87 | 2018-08-16 10:34:28 -0700 | [diff] [blame] | 64 | |
| 65 | // The attempt number of a target if the target ran several times. First |
| 66 | // attempt is 0 (Default value). |
| 67 | int64 attempt_id = 12; |
Julien Desprez | 093c3f6 | 2018-05-21 16:23:37 -0700 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | // A reference to a finer-grained TestRecord. |
| 71 | message ChildReference { |
| 72 | oneof reference { |
| 73 | // The UUID of the TestRecord. |
| 74 | string test_record_id = 1; |
| 75 | |
| 76 | // An inlined TestRecord. |
| 77 | TestRecord inline_test_record = 2; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | // The overall pass / fail status for a particular TestRecord. |
| 82 | enum TestStatus { |
| 83 | UNKNOWN = 0; |
| 84 | PASS = 1; |
| 85 | FAIL = 2; |
| 86 | IGNORED = 3; |
| 87 | ASSUMPTION_FAILURE = 4; |
| 88 | } |
| 89 | |
| 90 | // Associated debugging information to accompany a TestStatus. |
| 91 | message DebugInfo { |
| 92 | // An error message. |
| 93 | string error_message = 1; |
| 94 | |
| 95 | // A stacktrace. |
| 96 | string trace = 2; |
Julien Desprez | 69dcc6c | 2020-01-17 10:43:47 -0800 | [diff] [blame] | 97 | |
| 98 | // A more detailed failure status description. |
| 99 | FailureStatus failure_status = 3; |
Julien Desprez | 221aaf1 | 2020-02-27 14:17:03 -0800 | [diff] [blame] | 100 | |
| 101 | // Optional context to the failure |
| 102 | DebugInfoContext debug_info_context = 4; |
Julien Desprez | 69dcc6c | 2020-01-17 10:43:47 -0800 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | // A Fail TestStatus can be associated with a more granular failure status that helps understanding |
| 106 | // the context. |
| 107 | enum FailureStatus { |
Julien Desprez | 53af5fe | 2020-02-19 10:31:38 -0800 | [diff] [blame] | 108 | UNSET = 0; |
Julien Desprez | 69dcc6c | 2020-01-17 10:43:47 -0800 | [diff] [blame] | 109 | // The test in progress was the reason for the failure. |
Julien Desprez | 53af5fe | 2020-02-19 10:31:38 -0800 | [diff] [blame] | 110 | TEST_FAILURE = 1; |
Julien Desprez | 69dcc6c | 2020-01-17 10:43:47 -0800 | [diff] [blame] | 111 | // A timeout condition on the operation in progress occurred. |
Julien Desprez | 53af5fe | 2020-02-19 10:31:38 -0800 | [diff] [blame] | 112 | TIMED_OUT = 2; |
Julien Desprez | 69dcc6c | 2020-01-17 10:43:47 -0800 | [diff] [blame] | 113 | // The test in progress was cancelled. |
Julien Desprez | 53af5fe | 2020-02-19 10:31:38 -0800 | [diff] [blame] | 114 | CANCELLED = 3; |
Julien Desprez | 69dcc6c | 2020-01-17 10:43:47 -0800 | [diff] [blame] | 115 | // A failure attributed to something not functioning properly. |
| 116 | INFRA_FAILURE = 10; |
| 117 | // System under test crashed and caused the test to fail. |
| 118 | SYSTEM_UNDER_TEST_CRASHED = 20; |
Julien Desprez | 510c7dc | 2020-02-25 11:20:21 -0800 | [diff] [blame] | 119 | // The test was expected to run but did not. |
| 120 | NOT_EXECUTED = 30; |
Julien Desprez | 221aaf1 | 2020-02-27 14:17:03 -0800 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | // A context to DebugInfo that allows to optionally specify some debugging context. |
| 124 | message DebugInfoContext { |
| 125 | // Category of the action that was in progress during the failure |
| 126 | string action_in_progress = 1; |
| 127 | |
| 128 | // A free-formed text that can help debugging the issue at hand. |
| 129 | string debug_help_message = 10; |
Julien Desprez | 7b6361f | 2020-04-06 14:51:35 -0700 | [diff] [blame^] | 130 | |
| 131 | // The fully-qualified name of the exception class associated with the error. |
| 132 | string error_type = 20; |
| 133 | } |