github.com/GoogleCloudPlatform/testgrid@v0.0.174/pb/custom_evaluator/custom_evaluator.proto (about) 1 syntax = "proto3"; 2 3 package testgrid.custom_evaluator; 4 5 option go_package = "github.com/GoogleCloudPlatform/testgrid/pb/custom_evaluator"; 6 7 import "pb/test_status/test_status.proto"; 8 9 // A configuration sub-object used to do custom evaluation of test results. 10 11 // A collection of Rule objects. Used to define many rules. 12 message RuleSet { repeated Rule rules = 1; } 13 14 // A single rule that describes how to evaluate a test_cases_pb2.TestResult 15 message Rule { 16 // Multiple comparisons to run against a result. EVERY TestResultComparison 17 // has to succeed for this Rule to succeed. 18 repeated TestResultComparison test_result_comparisons = 1; 19 20 // Required: The TestStatus to return if the comparison succeeds. 21 testgrid.test_status.TestStatus computed_status = 3; 22 } 23 24 // Describes how to get information the TestResult proto and how to compare the 25 // value against the comparison value. 26 message TestResultComparison { 27 // Required: This is the comparison that will be used as 28 Comparison comparison = 1; 29 30 oneof test_result_info { 31 // The name of the property to evaluate. 32 // Properties are usually strings, so a string comparison is assumed and 33 // required. 34 string property_key = 2; 35 36 // This will find the scalar field with the given name within the TestResult 37 // proto. The value of that field will be used to evaluate. 38 // 39 // Accepted junit values for junit results are: 40 // name: name of the test case 41 // error_count: 1 if the test case has an error message 42 // failure_count: 1 if the test case has a failure message 43 // 44 // NOTE: Only supported for string and numerical values. 45 string test_result_field = 3; 46 47 // This will find the field nested within the first error of the TestResult 48 // proto. The value of that field will be used to evaluate. 49 // 50 // Accepted values for junit results are: 51 // exception_type: the failure and/or error message. 52 // 53 // NOTE: Only supported for string and numerical values 54 string test_result_error_field = 4; 55 56 // This will enable the target status comparation. The value of the status 57 // will be used to evaluate. 58 bool target_status = 5; 59 } 60 } 61 62 // The method of comparison used for evaluation. Describes how to compare two 63 // values. 64 message Comparison { 65 enum Operator { 66 // Unknown. May assume OP_EQ for legacy purposes, but should warn. 67 OP_UNKNOWN = 0; 68 69 // Equals operator. 70 OP_EQ = 1; 71 72 // Not equals operator. 73 OP_NE = 2; 74 75 // Comparison value less than TestResult's value 76 OP_LT = 3; 77 78 // Comparison value less than or equal TestResult's value 79 OP_LE = 4; 80 81 // Comparison value greater than TestResult's value 82 OP_GT = 5; 83 84 // Comparison value greater than or equal TestResult's value 85 OP_GE = 6; 86 87 // Regex match of Comparison.value string with the TestResult's evaluation 88 // value string. 89 OP_REGEX = 7; 90 91 // Checks to see if the evaluation value string starts with the 92 // Comparison.value string 93 OP_STARTS_WITH = 8; 94 95 // Checks to see if the evaluation value string is contained within the 96 // Comparison.value string 97 OP_CONTAINS = 9; 98 } 99 100 // Required: Defines how to compare two attributes. 101 // When the TestResult value is numerical, numerical_value will be used to 102 // compare. When the TestResult value is a string, string_value will be used. 103 Operator op = 1; 104 105 oneof comparison_value { 106 // For operations EQ, NE, REGEX, STARTS_WITH, CONTAINS 107 string string_value = 2; 108 109 // For operations EQ, NE, LT, LE, GT, GE 110 double numerical_value = 3; 111 112 // For operations EQ 113 testgrid.test_status.TestStatus target_status_value = 4; 114 } 115 }