blob: 4d1ef3ff14166c10f3761d074db4298403e8438e [file] [log] [blame]
// Copyright 2019 The LUCI Authors.
//
// 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";
package luci.resultsink.v1;
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "resultdb/proto/v1/common.proto";
import "resultdb/proto/v1/test_result.proto";
option go_package = "go.chromium.org/luci/resultdb/sink/proto/v1;sinkpb";
// A local equivalent of luci.resultdb.TestResult message
// in ../../v1/test_result.proto.
// See its comments for details.
message TestResult {
// Equivalent of luci.resultdb.v1.TestResult.TestId.
string test_id = 1;
// Equivalent of luci.resultdb.v1.TestResult.result_id.
//
// If omitted, a random, unique ID is generated..
string result_id = 2;
// Equivalent of luci.resultdb.v1.TestResult.expected.
bool expected = 3;
// Equivalent of luci.resultdb.v1.TestResult.status.
luci.resultdb.v1.TestStatus status = 4;
// Equivalent of luci.resultdb.v1.TestResult.summary_html.
string summary_html = 5;
// Equivalent of luci.resultdb.v1.TestResult.start_time.
google.protobuf.Timestamp start_time = 6;
// Equivalent of luci.resultdb.v1.TestResult.duration.
google.protobuf.Duration duration = 7;
// Equivalent of luci.resultdb.v1.TestResult.tags.
repeated luci.resultdb.v1.StringPair tags = 8;
// Artifacts to upload and associate with this test result.
// The map key is an artifact id.
map<string, Artifact> artifacts = 9;
// Equivalent of luci.resultdb.v1.TestResult.test_location.
luci.resultdb.v1.TestLocation test_location = 10;
}
// A local equivalent of luci.resultdb.Artifact message
// in ../../rpc/v1/artifact.proto.
// See its comments for details.
// Does not have a name or artifact_id because they are represented by the
// TestResult.artifacts map key.
message Artifact {
oneof body {
// Absolute path to the artifact file on the same machine as the
// ResultSink server.
string file_path = 1;
// Contents of the artifact. Useful when sending a file from a different
// machine.
// TODO(nodir, sajjadm): allow sending contents in chunks.
bytes contents = 2;
}
// Equivalent of luci.resultdb.v1.Artifact.content_type.
string content_type = 3;
}
// A file with test results.
message TestResultFile {
// Absolute OS-native path to the results file on the same machine as the
// ResultSink server.
string path = 1;
// A result file format.
enum Format {
// The file is a sequence of TestResult JSON objects (not a JSON Array).
// The default format.
LUCI = 0;
// Chromium's JSON Test Results format
// https://chromium.googlesource.com/chromium/src/+/master/docs/testing/json_test_results_format.md
CHROMIUM_JSON_TEST_RESULTS = 1;
// GTest format.
// Not well documented.
// Implementation:
// https://cs.chromium.org/chromium/src/base/test/launcher/test_results_tracker.cc
GOOGLE_TEST = 2;
}
// Format of the file.
Format format = 2;
}
// TODO(yuanzhi) Delete after http://fxr/425525 is submitted. This is kept around to not break CI
// Machine-readable status of a test result.
enum TestStatus {
// Status was not specified.
// Not to be used in actual test results; serves as a default value for an
// unset field.
STATUS_UNSPECIFIED = 0;
// The test case has passed.
PASS = 1;
// The test case has failed.
// Suggests that the code under test is incorrect, but it is also possible
// that the test is incorrect or it is a flake.
FAIL = 2;
// The test case has crashed during execution.
// The outcome is inconclusive: the code under test might or might not be
// correct, but the test+code is incorrect.
CRASH = 3;
// The test case has started, but was aborted before finishing.
// A common reason: timeout.
ABORT = 4;
// The test case did not execute.
// Examples:
// - The execution of the collection of test cases, such as a test
// binary, was aborted prematurely and execution of some test cases was
// skipped.
// - The test harness configuration specified that the test case MUST be
// skipped.
SKIP = 5;
}