config

package
v0.0.0-...-47f0c10 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractNamespaceFromTestName

func ExtractNamespaceFromTestName(in string) string

Types

type Component

type Component struct {
	Name                 string
	DefaultJiraProject   string
	DefaultJiraComponent string
	Matchers             []ComponentMatcher
	Operators            []string
	Namespaces           []string
	// Variants defines the list of variants a component is responsible for. The format of
	// each item is variantCategory:variantValue
	Variants []string

	// When a test is renamed, you can still look at results across releases by mapping new names
	// to the oldest version of the test.
	TestRenames map[string]string
}

Component is the default configuration struct that you can include in your own component implementation. It includes a matcher help that will identify if a test belongs to a sig, operator, as well as simple substring matching. Components do not need to use this framework, it's an optional add-on.

func (*Component) FindMatch

func (c *Component) FindMatch(test *v1.TestInfo) *ComponentMatcher

func (*Component) IdentifyVariants

func (c *Component) IdentifyVariants() ([]string, error)

func (*Component) IsInNamespace

func (c *Component) IsInNamespace(testNamespace string) bool

func (*Component) IsNamespaceTest

func (c *Component) IsNamespaceTest(testName string) (string, bool)

func (*Component) IsOperatorTest

func (c *Component) IsOperatorTest(test *v1.TestInfo) (bool, []string)

func (*Component) JiraProject

func (c *Component) JiraProject() string

func (*Component) ListNamespaces

func (c *Component) ListNamespaces() []string

type ComponentMatcher

type ComponentMatcher struct {
	SIG        string
	Suite      string
	IncludeAll []string
	IncludeAny []string
	ExcludeAll []string
	ExcludeAny []string

	JiraComponent string
	Capabilities  []string
	Priority      int
}

ComponentMatcher is used to match against a TestInfo struct. Note the fields SIG, Suite, IncludeAll, and ExcludeAll are ANDed together. That is, all that have values must match. For include and exclude, the individual items in the array are ANDed. That is, if you specify multiple substrings, all must match. Use separate component matchers for an OR operation.

The second set of fields are metadata used to assign ownership.

func (*ComponentMatcher) IsSubstringAllTest

func (cm *ComponentMatcher) IsSubstringAllTest(allOf []string, test *v1.TestInfo) bool

func (*ComponentMatcher) IsSubstringAnyTest

func (cm *ComponentMatcher) IsSubstringAnyTest(anyOf []string, test *v1.TestInfo) bool

func (*ComponentMatcher) IsSuiteTest

func (cm *ComponentMatcher) IsSuiteTest(test *v1.TestInfo) bool

Jump to

Keyboard shortcuts

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