rdb_publish_metadata: Add BaseVariant for test results
Pass base variant to rdb-publish to allow upload variant to ResultDB.
BUG=b:328220008
TEST=./generate.sh
Change-Id: Ifbc3fd3b1a7480c39ab5a819b25b54211dddeb20
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/config/+/5355128
Reviewed-by: Derek Beckett <dbeckett@chromium.org>
Reviewed-by: Jason Kusuma <jkusuma@google.com>
Commit-Queue: Zhihui Xie <zhihuixie@google.com>
diff --git a/generated/descriptors.json b/generated/descriptors.json
index bd6044e..43880fb 100644
--- a/generated/descriptors.json
+++ b/generated/descriptors.json
@@ -27753,6 +27753,14 @@
"number": 5,
"type": "TYPE_MESSAGE",
"typeName": ".chromiumos.test.api.metadata.PublishRdbMetadata.Sources"
+ },
+ {
+ "jsonName": "baseVariant",
+ "label": "LABEL_REPEATED",
+ "name": "base_variant",
+ "number": 6,
+ "type": "TYPE_MESSAGE",
+ "typeName": ".chromiumos.test.api.metadata.PublishRdbMetadata.BaseVariantEntry"
}
],
"name": "PublishRdbMetadata",
@@ -27775,6 +27783,28 @@
}
],
"name": "Sources"
+ },
+ {
+ "field": [
+ {
+ "jsonName": "key",
+ "label": "LABEL_OPTIONAL",
+ "name": "key",
+ "number": 1,
+ "type": "TYPE_STRING"
+ },
+ {
+ "jsonName": "value",
+ "label": "LABEL_OPTIONAL",
+ "name": "value",
+ "number": 2,
+ "type": "TYPE_STRING"
+ }
+ ],
+ "name": "BaseVariantEntry",
+ "options": {
+ "mapEntry": true
+ }
}
]
}
diff --git a/go/test/api/metadata/publish_rdb_metadata.pb.go b/go/test/api/metadata/publish_rdb_metadata.pb.go
index 9a1a8d8..db2d562 100644
--- a/go/test/api/metadata/publish_rdb_metadata.pb.go
+++ b/go/test/api/metadata/publish_rdb_metadata.pb.go
@@ -25,6 +25,7 @@
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
+// NEXT TAG: 7
type PublishRdbMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -42,6 +43,10 @@
TesthausUrl string `protobuf:"bytes,4,opt,name=testhaus_url,json=testhausUrl,proto3" json:"testhaus_url,omitempty"`
// The code sources tested.
Sources *PublishRdbMetadata_Sources `protobuf:"bytes,5,opt,name=sources,proto3" json:"sources,omitempty"`
+ // BaseVariant will be added to the variant of each test result within an
+ // invocation. If there are duplicate keys, the variant value given by the
+ // test command always wins.
+ BaseVariant map[string]string `protobuf:"bytes,6,rep,name=base_variant,json=baseVariant,proto3" json:"base_variant,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *PublishRdbMetadata) Reset() {
@@ -112,6 +117,13 @@
return nil
}
+func (x *PublishRdbMetadata) GetBaseVariant() map[string]string {
+ if x != nil {
+ return x.BaseVariant
+ }
+ return nil
+}
+
// Sources captures information about the code sources tested by
// the invocation.
type PublishRdbMetadata_Sources struct {
@@ -194,7 +206,7 @@
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x2a, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75,
0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63,
0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x03, 0x0a, 0x12, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52,
+ 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x04, 0x0a, 0x12, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52,
0x64, 0x62, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x15, 0x63, 0x75,
0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x63, 0x75, 0x72, 0x72, 0x65,
@@ -213,16 +225,27 @@
0x74, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
0x61, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x64, 0x62, 0x4d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x07, 0x73, 0x6f,
- 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x52, 0x0a, 0x07, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
- 0x12, 0x17, 0x0a, 0x07, 0x67, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x06, 0x67, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x13, 0x69, 0x73, 0x5f,
- 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x69, 0x72, 0x74, 0x79,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x69, 0x73, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79,
- 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x69, 0x72, 0x74, 0x79, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x6f, 0x2e,
- 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x63, 0x68, 0x72,
- 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67,
- 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64,
- 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x64, 0x0a, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x76, 0x61,
+ 0x72, 0x69, 0x61, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x63, 0x68,
+ 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70,
+ 0x69, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69,
+ 0x73, 0x68, 0x52, 0x64, 0x62, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x61,
+ 0x73, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b,
+ 0x62, 0x61, 0x73, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x1a, 0x52, 0x0a, 0x07, 0x53,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x73, 0x5f, 0x70, 0x61, 0x74,
+ 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12,
+ 0x2e, 0x0a, 0x13, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74,
+ 0x5f, 0x64, 0x69, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x69, 0x73,
+ 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x69, 0x72, 0x74, 0x79, 0x1a,
+ 0x3e, 0x0a, 0x10, 0x42, 0x61, 0x73, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x6e,
+ 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42,
+ 0x38, 0x5a, 0x36, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f,
+ 0x72, 0x67, 0x2f, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x61, 0x70, 0x69,
+ 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x33,
}
var (
@@ -237,20 +260,22 @@
return file_chromiumos_test_api_metadata_publish_rdb_metadata_proto_rawDescData
}
-var file_chromiumos_test_api_metadata_publish_rdb_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_chromiumos_test_api_metadata_publish_rdb_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_chromiumos_test_api_metadata_publish_rdb_metadata_proto_goTypes = []interface{}{
(*PublishRdbMetadata)(nil), // 0: chromiumos.test.api.metadata.PublishRdbMetadata
(*PublishRdbMetadata_Sources)(nil), // 1: chromiumos.test.api.metadata.PublishRdbMetadata.Sources
- (*artifact.TestResult)(nil), // 2: chromiumos.test.artifact.TestResult
+ nil, // 2: chromiumos.test.api.metadata.PublishRdbMetadata.BaseVariantEntry
+ (*artifact.TestResult)(nil), // 3: chromiumos.test.artifact.TestResult
}
var file_chromiumos_test_api_metadata_publish_rdb_metadata_proto_depIdxs = []int32{
- 2, // 0: chromiumos.test.api.metadata.PublishRdbMetadata.test_result:type_name -> chromiumos.test.artifact.TestResult
+ 3, // 0: chromiumos.test.api.metadata.PublishRdbMetadata.test_result:type_name -> chromiumos.test.artifact.TestResult
1, // 1: chromiumos.test.api.metadata.PublishRdbMetadata.sources:type_name -> chromiumos.test.api.metadata.PublishRdbMetadata.Sources
- 2, // [2:2] is the sub-list for method output_type
- 2, // [2:2] is the sub-list for method input_type
- 2, // [2:2] is the sub-list for extension type_name
- 2, // [2:2] is the sub-list for extension extendee
- 0, // [0:2] is the sub-list for field type_name
+ 2, // 2: chromiumos.test.api.metadata.PublishRdbMetadata.base_variant:type_name -> chromiumos.test.api.metadata.PublishRdbMetadata.BaseVariantEntry
+ 3, // [3:3] is the sub-list for method output_type
+ 3, // [3:3] is the sub-list for method input_type
+ 3, // [3:3] is the sub-list for extension type_name
+ 3, // [3:3] is the sub-list for extension extendee
+ 0, // [0:3] is the sub-list for field type_name
}
func init() { file_chromiumos_test_api_metadata_publish_rdb_metadata_proto_init() }
@@ -290,7 +315,7 @@
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_chromiumos_test_api_metadata_publish_rdb_metadata_proto_rawDesc,
NumEnums: 0,
- NumMessages: 2,
+ NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/proto/chromiumos/test/api/metadata/publish_rdb_metadata.proto b/proto/chromiumos/test/api/metadata/publish_rdb_metadata.proto
index b6df947..002a18b 100644
--- a/proto/chromiumos/test/api/metadata/publish_rdb_metadata.proto
+++ b/proto/chromiumos/test/api/metadata/publish_rdb_metadata.proto
@@ -10,6 +10,7 @@
import "chromiumos/test/artifact/test_result.proto";
+// NEXT TAG: 7
message PublishRdbMetadata {
// Current invocation id
string current_invocation_id = 1;
@@ -47,4 +48,9 @@
// The code sources tested.
Sources sources = 5;
+
+ // BaseVariant will be added to the variant of each test result within an
+ // invocation. If there are duplicate keys, the variant value given by the
+ // test command always wins.
+ map<string, string> base_variant = 6;
}
diff --git a/python/chromiumos/test/api/metadata/publish_rdb_metadata_pb2.py b/python/chromiumos/test/api/metadata/publish_rdb_metadata_pb2.py
index ca7a637..654491b 100644
--- a/python/chromiumos/test/api/metadata/publish_rdb_metadata_pb2.py
+++ b/python/chromiumos/test/api/metadata/publish_rdb_metadata_pb2.py
@@ -20,7 +20,7 @@
syntax='proto3',
serialized_options=b'Z6go.chromium.org/chromiumos/config/go/test/api/metadata',
create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n7chromiumos/test/api/metadata/publish_rdb_metadata.proto\x12\x1c\x63hromiumos.test.api.metadata\x1a*chromiumos/test/artifact/test_result.proto\"\xa3\x02\n\x12PublishRdbMetadata\x12\x1d\n\x15\x63urrent_invocation_id\x18\x01 \x01(\t\x12\x39\n\x0btest_result\x18\x02 \x01(\x0b\x32$.chromiumos.test.artifact.TestResult\x12\x19\n\rstainless_url\x18\x03 \x01(\tB\x02\x18\x01\x12\x14\n\x0ctesthaus_url\x18\x04 \x01(\t\x12I\n\x07sources\x18\x05 \x01(\x0b\x32\x38.chromiumos.test.api.metadata.PublishRdbMetadata.Sources\x1a\x37\n\x07Sources\x12\x0f\n\x07gs_path\x18\x01 \x01(\t\x12\x1b\n\x13is_deployment_dirty\x18\x02 \x01(\x08\x42\x38Z6go.chromium.org/chromiumos/config/go/test/api/metadatab\x06proto3'
+ serialized_pb=b'\n7chromiumos/test/api/metadata/publish_rdb_metadata.proto\x12\x1c\x63hromiumos.test.api.metadata\x1a*chromiumos/test/artifact/test_result.proto\"\xb0\x03\n\x12PublishRdbMetadata\x12\x1d\n\x15\x63urrent_invocation_id\x18\x01 \x01(\t\x12\x39\n\x0btest_result\x18\x02 \x01(\x0b\x32$.chromiumos.test.artifact.TestResult\x12\x19\n\rstainless_url\x18\x03 \x01(\tB\x02\x18\x01\x12\x14\n\x0ctesthaus_url\x18\x04 \x01(\t\x12I\n\x07sources\x18\x05 \x01(\x0b\x32\x38.chromiumos.test.api.metadata.PublishRdbMetadata.Sources\x12W\n\x0c\x62\x61se_variant\x18\x06 \x03(\x0b\x32\x41.chromiumos.test.api.metadata.PublishRdbMetadata.BaseVariantEntry\x1a\x37\n\x07Sources\x12\x0f\n\x07gs_path\x18\x01 \x01(\t\x12\x1b\n\x13is_deployment_dirty\x18\x02 \x01(\x08\x1a\x32\n\x10\x42\x61seVariantEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x38Z6go.chromium.org/chromiumos/config/go/test/api/metadatab\x06proto3'
,
dependencies=[chromiumos_dot_test_dot_artifact_dot_test__result__pb2.DESCRIPTOR,])
@@ -61,8 +61,46 @@
extension_ranges=[],
oneofs=[
],
- serialized_start=370,
- serialized_end=425,
+ serialized_start=459,
+ serialized_end=514,
+)
+
+_PUBLISHRDBMETADATA_BASEVARIANTENTRY = _descriptor.Descriptor(
+ name='BaseVariantEntry',
+ full_name='chromiumos.test.api.metadata.PublishRdbMetadata.BaseVariantEntry',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ create_key=_descriptor._internal_create_key,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='key', full_name='chromiumos.test.api.metadata.PublishRdbMetadata.BaseVariantEntry.key', index=0,
+ number=1, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=b"".decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ _descriptor.FieldDescriptor(
+ name='value', full_name='chromiumos.test.api.metadata.PublishRdbMetadata.BaseVariantEntry.value', index=1,
+ number=2, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=b"".decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=b'8\001',
+ is_extendable=False,
+ syntax='proto3',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=516,
+ serialized_end=566,
)
_PUBLISHRDBMETADATA = _descriptor.Descriptor(
@@ -108,10 +146,17 @@
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ _descriptor.FieldDescriptor(
+ name='base_variant', full_name='chromiumos.test.api.metadata.PublishRdbMetadata.base_variant', index=5,
+ number=6, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
- nested_types=[_PUBLISHRDBMETADATA_SOURCES, ],
+ nested_types=[_PUBLISHRDBMETADATA_SOURCES, _PUBLISHRDBMETADATA_BASEVARIANTENTRY, ],
enum_types=[
],
serialized_options=None,
@@ -121,12 +166,14 @@
oneofs=[
],
serialized_start=134,
- serialized_end=425,
+ serialized_end=566,
)
_PUBLISHRDBMETADATA_SOURCES.containing_type = _PUBLISHRDBMETADATA
+_PUBLISHRDBMETADATA_BASEVARIANTENTRY.containing_type = _PUBLISHRDBMETADATA
_PUBLISHRDBMETADATA.fields_by_name['test_result'].message_type = chromiumos_dot_test_dot_artifact_dot_test__result__pb2._TESTRESULT
_PUBLISHRDBMETADATA.fields_by_name['sources'].message_type = _PUBLISHRDBMETADATA_SOURCES
+_PUBLISHRDBMETADATA.fields_by_name['base_variant'].message_type = _PUBLISHRDBMETADATA_BASEVARIANTENTRY
DESCRIPTOR.message_types_by_name['PublishRdbMetadata'] = _PUBLISHRDBMETADATA
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
@@ -138,14 +185,23 @@
# @@protoc_insertion_point(class_scope:chromiumos.test.api.metadata.PublishRdbMetadata.Sources)
})
,
+
+ 'BaseVariantEntry' : _reflection.GeneratedProtocolMessageType('BaseVariantEntry', (_message.Message,), {
+ 'DESCRIPTOR' : _PUBLISHRDBMETADATA_BASEVARIANTENTRY,
+ '__module__' : 'chromiumos.test.api.metadata.publish_rdb_metadata_pb2'
+ # @@protoc_insertion_point(class_scope:chromiumos.test.api.metadata.PublishRdbMetadata.BaseVariantEntry)
+ })
+ ,
'DESCRIPTOR' : _PUBLISHRDBMETADATA,
'__module__' : 'chromiumos.test.api.metadata.publish_rdb_metadata_pb2'
# @@protoc_insertion_point(class_scope:chromiumos.test.api.metadata.PublishRdbMetadata)
})
_sym_db.RegisterMessage(PublishRdbMetadata)
_sym_db.RegisterMessage(PublishRdbMetadata.Sources)
+_sym_db.RegisterMessage(PublishRdbMetadata.BaseVariantEntry)
DESCRIPTOR._options = None
+_PUBLISHRDBMETADATA_BASEVARIANTENTRY._options = None
_PUBLISHRDBMETADATA.fields_by_name['stainless_url']._options = None
# @@protoc_insertion_point(module_scope)