• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
21import "google/protobuf/struct.proto";
22import "google/api/field_behavior.proto";
23import public "tools/tradefederation/core/proto/resultdb/common.proto";
24
25option go_package = "go.chromium.org/luci/resultdb/proto/v1;resultpb";
26option java_package = "com.android.resultdb.proto";
27option java_multiple_files = true;
28
29// Information about a test metadata.
30message TestMetadataDetail {
31  // Can be used to refer to a test metadata, e.g. in ResultDB.QueryTestMetadata
32  // RPC.
33  // Format:
34  // "projects/{PROJECT}/refs/{REF_HASH}/tests/{URL_ESCAPED_TEST_ID}".
35  // where URL_ESCAPED_TEST_ID is test_id escaped with
36  // https://golang.org/pkg/net/url/#PathEscape. See also https://aip.dev/122.
37  //
38  // Output only.
39  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
40
41  // The LUCI project.
42  string project = 2;
43
44  // A unique identifier of a test in a LUCI project.
45  // Refer to TestResult.test_id for details.
46  string test_id = 3;
47
48  // Hexadecimal encoded hash string of the source_ref.
49  // A given source_ref always hashes to the same ref_hash value.
50  string ref_hash = 12;
51
52  // A reference in the source control system where the test metadata comes from.
53  SourceRef source_ref = 4;
54
55  // Test metadata content.
56  TestMetadata testMetadata = 5;
57}
58
59// Information about a test.
60message TestMetadata {
61  // The original test name.
62  string name = 1;
63
64  // Where the test is defined, e.g. the file name.
65  // location.repo MUST be specified.
66  TestLocation location = 2;
67
68  // The issue tracker component associated with the test, if any.
69  // Bugs related to the test may be filed here.
70  BugComponent bug_component = 3;
71
72  // Identifies the schema of the JSON object in the properties field.
73  // Use the fully-qualified name of the source protocol buffer.
74  // eg. chromiumos.test.api.TestCaseInfo
75  // ResultDB will *not* validate the properties field with respect to this
76  // schema. Downstream systems may however use this field to inform how the
77  // properties field is interpreted.
78  string properties_schema = 4;
79
80  // Arbitrary JSON object that contains structured, domain-specific properties
81  // of the test.
82  //
83  // The serialized size must be <= 4096 bytes.
84  //
85  // If this field is specified, properties_schema must also be specified.
86  google.protobuf.Struct properties = 5;
87}
88
89// Location of the test definition.
90message TestLocation {
91  // Gitiles URL as the identifier for a repo.
92  // Format for Gitiles URL: https://<host>/<project>
93  // For example "https://chromium.googlesource.com/chromium/src"
94  // Must not end with ".git".
95  // SHOULD be specified.
96  string repo = 1;
97
98  // Name of the file where the test is defined.
99  // For files in a repository, must start with "//"
100  // Example: "//components/payments/core/payment_request_data_util_unittest.cc"
101  // Max length: 512.
102  // MUST not use backslashes.
103  // Required.
104  string file_name = 2;
105
106  // One-based line number where the test is defined.
107  int32 line = 3;
108}
109
110// Represents a component in an issue tracker. A component is
111// a container for issues.
112message BugComponent {
113  oneof system {
114     // The Google Issue Tracker component.
115     IssueTrackerComponent issue_tracker = 1;
116
117     // The monorail component.
118     MonorailComponent monorail = 2;
119  }
120}
121
122// A component in Google Issue Tracker, sometimes known as Buganizer,
123// available at https://issuetracker.google.com.
124message IssueTrackerComponent {
125  // The Google Issue Tracker component ID.
126  int64 component_id = 1;
127}
128
129// A component in monorail issue tracker, available at
130// https://bugs.chromium.org.
131message MonorailComponent {
132  // The monorail project name.
133  string project = 1;
134  // The monorail component value. E.g. "Blink>Accessibility".
135  string value = 2;
136}
137