1// Copyright 2021 The ChromiumOS Authors 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5syntax = "proto3"; 6 7package chromiumos.test.api; 8 9option go_package = "go.chromium.org/chromiumos/config/go/test/api"; 10 11import "google/protobuf/duration.proto"; 12import "google/protobuf/timestamp.proto"; 13import "chromiumos/storage_path.proto"; 14import "chromiumos/test/api/test_case.proto"; 15import "chromiumos/test/api/test_harness.proto"; 16import "chromiumos/test/api/test_case_metadata.proto"; 17 18// Result of a single execution of a given TestCase. 19// NEXT TAG: 18 20message TestCaseResult { 21 reserved 15; 22 23 // Unique ID of test case executed 24 TestCase.Id test_case_id = 1; 25 26 // Additional properties of the test case. 27 repeated TestCase.Tag tags = 17; 28 29 // Location of the test result artifacts generated during execution. 30 StoragePath result_dir_path = 2; 31 32 oneof verdict { 33 // Set if test ran successfully and passed. 34 Pass pass = 3; 35 // Set if test ran successfully and failed. 36 Fail fail = 4; 37 // Set if test execution encountered errors (i.e. started/attempted). 38 Crash crash = 5; 39 // Set if test execution was aborted before finishing either due to system 40 // limitation or user requests. 41 Abort abort = 6; 42 // Set if test was skipped due to dependency requirements. 43 Skip skip = 7; 44 // Set if test did not run. 45 NotRun not_run = 8; 46 } 47 48 // Reason associated with status above to provide more information. 49 // 50 // For fail/crash/abort statuses, the `errors` collection below 51 // should be populated in preference to this field. For skip or 52 // not_run status, this field may be used to communicate why the 53 // test was skipped or not run. 54 string reason = 9; 55 56 // Test harness information. 57 TestHarness test_harness = 10; 58 59 // The time when the test case started to execute. 60 google.protobuf.Timestamp start_time = 11; 61 62 // Duration of the test case execution. 63 google.protobuf.Duration duration = 12; 64 65 // Bool to show if the test was a retry or not. 66 bool retry = 13; 67 68 // The metadata of the test. 69 api.TestCaseMetadata test_case_metadata = 14; 70 71 // The error(s) that caused the test to fail. 72 // 73 // If there is more than one error (e.g. due to multiple expectation failures), 74 // a stable sorting should be used. A recommended form of stable sorting is: 75 // - Fatal errors (errors that cause the test to terminate immediately first, 76 // then 77 // - Within fatal/non-fatal errors, sort by chronological order 78 // (earliest error first). 79 repeated Error errors = 16; 80 81 // Error represents a problem that caused a test to fail, such as a crash 82 // or expectation failure. 83 message Error { 84 // The error message. This should only be the error message and 85 // should not include any stack traces. An example would be the 86 // message passed to .Error(...) in a Tast test. 87 // 88 // This message may be used to cluster related failures together. 89 string message = 1; 90 } 91 92 message Artifacts { 93 } 94 95 message Pass { 96 } 97 98 message Fail { 99 } 100 101 message Crash { 102 } 103 104 message Abort { 105 } 106 107 message Skip { 108 } 109 110 message NotRun { 111 } 112} 113