1/*
2 * Copyright (C) 2024 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
17syntax = "proto3";
18
19package luci.resultdb.v1;
20
21option go_package = "go.chromium.org/luci/resultdb/proto/v1;resultpb";
22option java_package = "com.android.resultdb.proto";
23option java_multiple_files = true;
24
25// Information about why a test failed. This information may be displayed
26// to developers in result viewing UIs and will also be used to cluster
27// similar failures together.
28// For example, this will contain assertion failure messages and stack traces.
29message FailureReason {
30  // The error message that ultimately caused the test to fail. This should
31  // only be the error message and should not include any stack traces.
32  // An example would be the message from an Exception in a Java test.
33  // In the case that a test failed due to multiple expectation failures, any
34  // immediately fatal failure should be chosen, or otherwise the first
35  // expectation failure.
36  // If this field is empty, other fields (including those from the TestResult)
37  // may be used to cluster the failure instead.
38  //
39  // The size of the message must be equal to or smaller than 1024 bytes in
40  // UTF-8.
41  string primary_error_message = 1;
42
43  // Error represents a problem that caused a test to fail, such as a crash
44  // or expectation failure.
45  message Error {
46    // The error message. This should only be the error message and
47    // should not include any stack traces. An example would be the
48    // message from an Exception in a Java test.
49    //
50    // This message may be used to cluster related failures together.
51    //
52    // The size of the message must be equal to or smaller than 1024 bytes in
53    // UTF-8.
54    string message = 1;
55  }
56
57  // The error(s) that caused the test to fail.
58  //
59  // If there is more than one error (e.g. due to multiple expectation failures),
60  // a stable sorting should be used. A recommended form of stable sorting is:
61  // - Fatal errors (errors that cause the test to terminate immediately first,
62  //   then
63  // - Within fatal/non-fatal errors, sort by chronological order
64  //   (earliest error first).
65  //
66  // Where this field is populated, errors[0].message shall match
67  // primary_error_message.
68  //
69  // The total combined size of all errors (as measured by proto.Size()) must
70  // not exceed 3,172 bytes.
71  repeated Error errors = 2;
72
73  // The number of errors that are truncated from the errors list above due to
74  // the size limits.
75  int32 truncated_errors_count = 3;
76}
77