go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/resultdb/sink/proto/v1/test_result.proto (about)

     1  // Copyright 2019 The LUCI Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  syntax = "proto3";
    16  
    17  package luci.resultsink.v1;
    18  
    19  import "google/protobuf/duration.proto";
    20  import "google/protobuf/struct.proto";
    21  import "google/protobuf/timestamp.proto";
    22  import "go.chromium.org/luci/resultdb/proto/v1/common.proto";
    23  import "go.chromium.org/luci/resultdb/proto/v1/failure_reason.proto";
    24  import "go.chromium.org/luci/resultdb/proto/v1/test_metadata.proto";
    25  import "go.chromium.org/luci/resultdb/proto/v1/test_result.proto";
    26  
    27  option go_package = "go.chromium.org/luci/resultdb/sink/proto/v1;sinkpb";
    28  
    29  // A local equivalent of luci.resultdb.TestResult message
    30  // in ../../v1/test_result.proto.
    31  // See its comments for details.
    32  message TestResult {
    33    reserved 10; // test_location
    34    reserved "test_location";
    35  
    36    // Equivalent of luci.resultdb.v1.TestResult.TestId.
    37    string test_id = 1;
    38  
    39    // Equivalent of luci.resultdb.v1.TestResult.result_id.
    40    //
    41    // If omitted, a random, unique ID is generated..
    42    string result_id = 2;
    43  
    44    // Equivalent of luci.resultdb.v1.TestResult.expected.
    45    bool expected = 3;
    46  
    47    // Equivalent of luci.resultdb.v1.TestResult.status.
    48    luci.resultdb.v1.TestStatus status = 4;
    49  
    50    // Equivalent of luci.resultdb.v1.TestResult.summary_html.
    51    string summary_html = 5;
    52  
    53    // Equivalent of luci.resultdb.v1.TestResult.start_time.
    54    google.protobuf.Timestamp start_time = 6;
    55  
    56    // Equivalent of luci.resultdb.v1.TestResult.duration.
    57    google.protobuf.Duration duration = 7;
    58  
    59    // Equivalent of luci.resultdb.v1.TestResult.tags.
    60    repeated luci.resultdb.v1.StringPair tags = 8;
    61  
    62    // Artifacts to upload and associate with this test result.
    63    // The map key is an artifact id.
    64    map<string, Artifact> artifacts = 9;
    65  
    66    // Equivalent of luci.resultdb.v1.TestResult.test_metadata.
    67    luci.resultdb.v1.TestMetadata test_metadata = 11;
    68  
    69    // Equivalent of luci.resultdb.v1.TestResult.failure_reason.
    70    luci.resultdb.v1.FailureReason failure_reason = 12;
    71  
    72    // Equivalent of luci.resultdb.v1.TestResult.variant.
    73    // The variant for all test cases should be passed by command line args to rdb
    74    // stream, however you can override or add to the variant on a per test case
    75    // basis using this field.
    76    luci.resultdb.v1.Variant variant = 13;
    77  
    78    // Arbitrary JSON object that contains structured, domain-specific properties
    79    // of the test result.
    80    //
    81    // The serialized size must be <= 4096 bytes.
    82    google.protobuf.Struct properties = 14;
    83  }
    84  
    85  // A local equivalent of luci.resultdb.Artifact message
    86  // in ../../rpc/v1/artifact.proto.
    87  // See its comments for details.
    88  // Does not have a name or artifact_id because they are represented by the
    89  // TestResult.artifacts map key.
    90  // Next id: 5
    91  message Artifact {
    92    // Body should be only one of the following:
    93    // - file_path (file should exist. contents & gcs_uri should not be set)
    94    // - contents (file_path & gcs_uri should not be set)
    95    // - gcs_uri for GCS artifact (file_path & contents should not be set)
    96    oneof body {
    97      // Absolute path to the artifact file on the same machine as the
    98      // ResultSink server.
    99      string file_path = 1;
   100  
   101      // Contents of the artifact. Useful when sending a file from a different
   102      // machine.
   103      // TODO(nodir, sajjadm): allow sending contents in chunks.
   104      bytes contents = 2;
   105  
   106      // The GCS URI of the artifact if it's stored in GCS.
   107      string gcs_uri = 4;
   108    }
   109  
   110    // Equivalent of luci.resultdb.v1.Artifact.content_type.
   111    string content_type = 3;
   112  }
   113  
   114  // A file with test results.
   115  message TestResultFile {
   116    // Absolute OS-native path to the results file on the same machine as the
   117    // ResultSink server.
   118    string path = 1;
   119  
   120    // A result file format.
   121    enum Format {
   122      // The file is a sequence of TestResult JSON objects (not a JSON Array).
   123      // The default format.
   124      LUCI = 0;
   125  
   126      // Chromium's JSON Test Results format
   127      // https://chromium.googlesource.com/chromium/src/+/master/docs/testing/json_test_results_format.md
   128      CHROMIUM_JSON_TEST_RESULTS = 1;
   129  
   130      // GTest format.
   131      // Not well documented.
   132      // Implementation:
   133      // https://cs.chromium.org/chromium/src/base/test/launcher/test_results_tracker.cc
   134      GOOGLE_TEST = 2;
   135    }
   136  
   137    // Format of the file.
   138    Format format = 2;
   139  }