go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/resultdb/proto/v1/test_variant.proto (about) 1 // Copyright 2021 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.resultdb.v1; 18 19 import "google/api/field_behavior.proto"; 20 import "go.chromium.org/luci/resultdb/proto/v1/common.proto"; 21 import "go.chromium.org/luci/resultdb/proto/v1/test_metadata.proto"; 22 import "go.chromium.org/luci/resultdb/proto/v1/test_result.proto"; 23 24 option go_package = "go.chromium.org/luci/resultdb/proto/v1;resultpb"; 25 26 // Represents a matching test variant with its outcomes. 27 message TestVariant { 28 // A unique identifier of the test in a LUCI project. 29 // Regex: ^[[::print::]]{1,256}$ 30 // 31 // Refer to TestResult.test_id for details. 32 string test_id = 1; 33 34 // Description of one specific way of running the test, 35 // e.g. a specific bucket, builder and a test suite. 36 Variant variant = 2; 37 38 // Hash of the variant. 39 // hex(sha256(sorted(''.join('%s:%s\n' for k, v in variant.items())))). 40 string variant_hash = 3; 41 42 // Status of the test variant. 43 TestVariantStatus status = 4; 44 45 // Outcomes of the test variant. 46 repeated TestResultBundle results = 5; 47 48 // Test exonerations if any test variant is exonerated. 49 repeated TestExoneration exonerations = 6; 50 51 // Information about the test at the time of its execution. 52 // 53 // All test results of the same test variant should report the same test 54 // metadata. This RPC relies on this rule and returns test metadata from 55 // *arbitrary* result of the test variant. 56 TestMetadata test_metadata = 7; 57 58 // Whether the 59 // - test metadata; or 60 // - the variant definition; or 61 // - both the test metadata and variant definition 62 // have been masked from the test variant. 63 // 64 // Output only. 65 bool is_masked = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; 66 67 // The identity of the code sources tested. This ID can be used 68 // to lookup of the actual sources in QueryTestVariantsResponse.sources. 69 // 70 // All test results of the same test variant should be attached to the same 71 // sources (via their respective invocation(s)). This RPC relies upon this 72 // and returns sources from an *arbitrary* result of the test variant. 73 // 74 // If the code sources tested are not available, this field is blank. 75 string sources_id = 9; 76 } 77 78 // Outcomes of an execution of the test variant. 79 message TestResultBundle { 80 // Result of the test variant execution. 81 TestResult result = 1; 82 } 83 84 // Status of a test variant. 85 enum TestVariantStatus { 86 // a test variant must not have this status. 87 // This is only used when filtering variants. 88 TEST_VARIANT_STATUS_UNSPECIFIED = 0; 89 // The test variant has no exonerations, and all results are unexpected. 90 UNEXPECTED = 10; 91 // The test variant has no exonerations, and all results are unexpectedly skipped. 92 UNEXPECTEDLY_SKIPPED = 20; 93 // The test variant has no exonerations, and has both expected and unexpected 94 // results. 95 FLAKY = 30; 96 // The test variant has one or more test exonerations. 97 EXONERATED = 40; 98 // A special value that matches any test variant which doesn't have the status 99 // EXPECTED. This includes all the above statuses. It will never be present on 100 // returned results, it's only for use in predicates. 101 UNEXPECTED_MASK = 45; 102 // The test variant has no exonerations, and all results are expected. 103 EXPECTED = 50; 104 } 105 106 // Represents a function TestVariant -> bool. 107 // Empty message matches all test variants. 108 message TestVariantPredicate { 109 // A test variant must have this status. 110 TestVariantStatus status = 1; 111 }