custom_evaluator

package
v0.0.173 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Comparison_Operator_name = map[int32]string{
		0: "OP_UNKNOWN",
		1: "OP_EQ",
		2: "OP_NE",
		3: "OP_LT",
		4: "OP_LE",
		5: "OP_GT",
		6: "OP_GE",
		7: "OP_REGEX",
		8: "OP_STARTS_WITH",
		9: "OP_CONTAINS",
	}
	Comparison_Operator_value = map[string]int32{
		"OP_UNKNOWN":     0,
		"OP_EQ":          1,
		"OP_NE":          2,
		"OP_LT":          3,
		"OP_LE":          4,
		"OP_GT":          5,
		"OP_GE":          6,
		"OP_REGEX":       7,
		"OP_STARTS_WITH": 8,
		"OP_CONTAINS":    9,
	}
)

Enum value maps for Comparison_Operator.

View Source
var File_custom_evaluator_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Comparison

type Comparison struct {

	// Required: Defines how to compare two attributes.
	// When the TestResult value is numerical, numerical_value will be used to
	// compare. When the TestResult value is a string, string_value will be used.
	Op Comparison_Operator `protobuf:"varint,1,opt,name=op,proto3,enum=testgrid.custom_evaluator.Comparison_Operator" json:"op,omitempty"`
	// Types that are assignable to ComparisonValue:
	//	*Comparison_StringValue
	//	*Comparison_NumericalValue
	//	*Comparison_TargetStatusValue
	ComparisonValue isComparison_ComparisonValue `protobuf_oneof:"comparison_value"`
	// contains filtered or unexported fields
}

The method of comparison used for evaluation. Describes how to compare two values.

func (*Comparison) Descriptor deprecated

func (*Comparison) Descriptor() ([]byte, []int)

Deprecated: Use Comparison.ProtoReflect.Descriptor instead.

func (*Comparison) GetComparisonValue

func (m *Comparison) GetComparisonValue() isComparison_ComparisonValue

func (*Comparison) GetNumericalValue

func (x *Comparison) GetNumericalValue() float64

func (*Comparison) GetOp

func (x *Comparison) GetOp() Comparison_Operator

func (*Comparison) GetStringValue

func (x *Comparison) GetStringValue() string

func (*Comparison) GetTargetStatusValue added in v0.0.158

func (x *Comparison) GetTargetStatusValue() test_status.TestStatus

func (*Comparison) ProtoMessage

func (*Comparison) ProtoMessage()

func (*Comparison) ProtoReflect added in v0.0.91

func (x *Comparison) ProtoReflect() protoreflect.Message

func (*Comparison) Reset

func (x *Comparison) Reset()

func (*Comparison) String

func (x *Comparison) String() string

type Comparison_NumericalValue

type Comparison_NumericalValue struct {
	// For operations EQ, NE, LT, LE, GT, GE
	NumericalValue float64 `protobuf:"fixed64,3,opt,name=numerical_value,json=numericalValue,proto3,oneof"`
}

type Comparison_Operator

type Comparison_Operator int32
const (
	// Unknown. May assume OP_EQ for legacy purposes, but should warn.
	Comparison_OP_UNKNOWN Comparison_Operator = 0
	// Equals operator.
	Comparison_OP_EQ Comparison_Operator = 1
	// Not equals operator.
	Comparison_OP_NE Comparison_Operator = 2
	// Comparison value less than TestResult's value
	Comparison_OP_LT Comparison_Operator = 3
	// Comparison value less than or equal TestResult's value
	Comparison_OP_LE Comparison_Operator = 4
	// Comparison value greater than TestResult's value
	Comparison_OP_GT Comparison_Operator = 5
	// Comparison value greater than or equal TestResult's value
	Comparison_OP_GE Comparison_Operator = 6
	// Regex match of Comparison.value string with the TestResult's evaluation
	// value string.
	Comparison_OP_REGEX Comparison_Operator = 7
	// Checks to see if the evaluation value string starts with the
	// Comparison.value string
	Comparison_OP_STARTS_WITH Comparison_Operator = 8
	// Checks to see if the evaluation value string is contained within the
	// Comparison.value string
	Comparison_OP_CONTAINS Comparison_Operator = 9
)

func (Comparison_Operator) Descriptor added in v0.0.91

func (Comparison_Operator) Enum added in v0.0.91

func (Comparison_Operator) EnumDescriptor deprecated

func (Comparison_Operator) EnumDescriptor() ([]byte, []int)

Deprecated: Use Comparison_Operator.Descriptor instead.

func (Comparison_Operator) Number added in v0.0.91

func (Comparison_Operator) String

func (x Comparison_Operator) String() string

func (Comparison_Operator) Type added in v0.0.91

type Comparison_StringValue

type Comparison_StringValue struct {
	// For operations EQ, NE, REGEX, STARTS_WITH, CONTAINS
	StringValue string `protobuf:"bytes,2,opt,name=string_value,json=stringValue,proto3,oneof"`
}

type Comparison_TargetStatusValue added in v0.0.158

type Comparison_TargetStatusValue struct {
	// For operations EQ
	TargetStatusValue test_status.TestStatus `protobuf:"varint,4,opt,name=target_status_value,json=targetStatusValue,proto3,enum=testgrid.test_status.TestStatus,oneof"`
}

type Rule

type Rule struct {

	// Multiple comparisons to run against a result. EVERY TestResultComparison
	// has to succeed for this Rule to succeed.
	TestResultComparisons []*TestResultComparison `` /* 126-byte string literal not displayed */
	// Required: The TestStatus to return if the comparison succeeds.
	ComputedStatus test_status.TestStatus `` /* 141-byte string literal not displayed */
	// contains filtered or unexported fields
}

A single rule that describes how to evaluate a test_cases_pb2.TestResult

func (*Rule) Descriptor deprecated

func (*Rule) Descriptor() ([]byte, []int)

Deprecated: Use Rule.ProtoReflect.Descriptor instead.

func (*Rule) GetComputedStatus

func (x *Rule) GetComputedStatus() test_status.TestStatus

func (*Rule) GetTestResultComparisons

func (x *Rule) GetTestResultComparisons() []*TestResultComparison

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) ProtoReflect added in v0.0.91

func (x *Rule) ProtoReflect() protoreflect.Message

func (*Rule) Reset

func (x *Rule) Reset()

func (*Rule) String

func (x *Rule) String() string

type RuleSet

type RuleSet struct {
	Rules []*Rule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
	// contains filtered or unexported fields
}

A collection of Rule objects. Used to define many rules.

func (*RuleSet) Descriptor deprecated

func (*RuleSet) Descriptor() ([]byte, []int)

Deprecated: Use RuleSet.ProtoReflect.Descriptor instead.

func (*RuleSet) GetRules

func (x *RuleSet) GetRules() []*Rule

func (*RuleSet) ProtoMessage

func (*RuleSet) ProtoMessage()

func (*RuleSet) ProtoReflect added in v0.0.91

func (x *RuleSet) ProtoReflect() protoreflect.Message

func (*RuleSet) Reset

func (x *RuleSet) Reset()

func (*RuleSet) String

func (x *RuleSet) String() string

type TestResultComparison

type TestResultComparison struct {

	// Required: This is the comparison that will be used as
	Comparison *Comparison `protobuf:"bytes,1,opt,name=comparison,proto3" json:"comparison,omitempty"`
	// Types that are assignable to TestResultInfo:
	//	*TestResultComparison_PropertyKey
	//	*TestResultComparison_TestResultField
	//	*TestResultComparison_TestResultErrorField
	//	*TestResultComparison_TargetStatus
	TestResultInfo isTestResultComparison_TestResultInfo `protobuf_oneof:"test_result_info"`
	// contains filtered or unexported fields
}

Describes how to get information the TestResult proto and how to compare the value against the comparison value.

func (*TestResultComparison) Descriptor deprecated

func (*TestResultComparison) Descriptor() ([]byte, []int)

Deprecated: Use TestResultComparison.ProtoReflect.Descriptor instead.

func (*TestResultComparison) GetComparison

func (x *TestResultComparison) GetComparison() *Comparison

func (*TestResultComparison) GetPropertyKey

func (x *TestResultComparison) GetPropertyKey() string

func (*TestResultComparison) GetTargetStatus added in v0.0.158

func (x *TestResultComparison) GetTargetStatus() bool

func (*TestResultComparison) GetTestResultErrorField

func (x *TestResultComparison) GetTestResultErrorField() string

func (*TestResultComparison) GetTestResultField

func (x *TestResultComparison) GetTestResultField() string

func (*TestResultComparison) GetTestResultInfo

func (m *TestResultComparison) GetTestResultInfo() isTestResultComparison_TestResultInfo

func (*TestResultComparison) ProtoMessage

func (*TestResultComparison) ProtoMessage()

func (*TestResultComparison) ProtoReflect added in v0.0.91

func (x *TestResultComparison) ProtoReflect() protoreflect.Message

func (*TestResultComparison) Reset

func (x *TestResultComparison) Reset()

func (*TestResultComparison) String

func (x *TestResultComparison) String() string

type TestResultComparison_PropertyKey

type TestResultComparison_PropertyKey struct {
	// The name of the property to evaluate.
	// Properties are usually strings, so a string comparison is assumed and
	// required.
	PropertyKey string `protobuf:"bytes,2,opt,name=property_key,json=propertyKey,proto3,oneof"`
}

type TestResultComparison_TargetStatus added in v0.0.158

type TestResultComparison_TargetStatus struct {
	// This will enable the target status comparation. The value of the status
	// will be used to evaluate.
	TargetStatus bool `protobuf:"varint,5,opt,name=target_status,json=targetStatus,proto3,oneof"`
}

type TestResultComparison_TestResultErrorField

type TestResultComparison_TestResultErrorField struct {
	// This will find the field nested within the first error of the TestResult
	// proto. The value of that field will be used to evaluate.
	//
	// Accepted values for junit results are:
	//   exception_type: the failure and/or error message.
	//
	// NOTE: Only supported for string and numerical values
	TestResultErrorField string `protobuf:"bytes,4,opt,name=test_result_error_field,json=testResultErrorField,proto3,oneof"`
}

type TestResultComparison_TestResultField

type TestResultComparison_TestResultField struct {
	// This will find the scalar field with the given name within the TestResult
	// proto. The value of that field will be used to evaluate.
	//
	// Accepted junit values for junit results are:
	//   name: name of the test case
	//   error_count: 1 if the test case has an error message
	//   failure_count: 1 if the test case has a failure message
	//
	// NOTE: Only supported for string and numerical values.
	TestResultField string `protobuf:"bytes,3,opt,name=test_result_field,json=testResultField,proto3,oneof"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL