Create a reporter to populate the test record proto
Create a base abstract class that populates the test record
protobuf, a representation of Tradefed results.
The reporter should be extended to handle the final proto
and what should be done with it.
Test: unit tests
Bug: 79990695
Change-Id: I04081e538100b028094cc288ffe714e269a0b7dd
diff --git a/proto/test_record.proto b/proto/test_record.proto
new file mode 100644
index 0000000..d4769ea
--- /dev/null
+++ b/proto/test_record.proto
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+syntax = "proto3";
+
+import "google/protobuf/any.proto";
+import "google/protobuf/timestamp.proto";
+import "tools/tradefederation/core/proto/metric_measurement.proto";
+
+option java_package = "com.tradefed.result.proto";
+option java_outer_classname = "TestRecordProto";
+
+package android_test_record;
+
+// A record containing the status, logs, and other information associated with a
+// particular test execution.
+message TestRecord {
+ // The UUID of this TestRecord.
+ string test_record_id = 1;
+
+ // The UUID of this TestRecord's parent. Unset if this is a top-level record.
+ string parent_test_record_id = 2;
+
+ // References to any finer-grained TestRecords that were generated as part of
+ // this test.
+ repeated ChildReference children = 3;
+
+ // The number of children this TestRecord was expected to have. Unset if not
+ // known in advance.
+ int64 num_expected_children = 4;
+
+ // The result status (Pass, Fail, etc) of this test unit.
+ TestStatus status = 5;
+
+ // Extra debugging information.
+ DebugInfo debug_info = 6;
+
+ // The time at which this test started executing.
+ google.protobuf.Timestamp start_time = 7;
+
+ // The time at which this test finished executing.
+ google.protobuf.Timestamp end_time = 8;
+
+ // Any artifact files associated with this test.
+ map<string, google.protobuf.Any> artifacts = 9;
+
+ // Any metrics or measurements associated with this test.
+ map<string, tradefed.metric.Metric> metrics = 10;
+
+ // Metadata describing the test that was run.
+ google.protobuf.Any description = 11;
+}
+
+// A reference to a finer-grained TestRecord.
+message ChildReference {
+ oneof reference {
+ // The UUID of the TestRecord.
+ string test_record_id = 1;
+
+ // An inlined TestRecord.
+ TestRecord inline_test_record = 2;
+ }
+}
+
+// The overall pass / fail status for a particular TestRecord.
+enum TestStatus {
+ UNKNOWN = 0;
+ PASS = 1;
+ FAIL = 2;
+ IGNORED = 3;
+ ASSUMPTION_FAILURE = 4;
+}
+
+// Associated debugging information to accompany a TestStatus.
+message DebugInfo {
+ // An error message.
+ string error_message = 1;
+
+ // A stacktrace.
+ string trace = 2;
+}
\ No newline at end of file