conformance

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package conformance is a framework for conformance test

Index

Constants

This section is empty.

Variables

View Source
var Configure = base.ConfigureFunc(func(suiteConfig *types.SuiteConfig, reporterConfig *types.ReporterConfig) {

	if suiteConfig.LabelFilter == "" {
		suiteConfig.LabelFilter = strings.Join(GlobalModuleCaseLabels(), ",")
	}
})

Functions

func GlobalModuleCaseLabels

func GlobalModuleCaseLabels() Labels

GlobalModuleCaseLabels get all labels of conformance testcases

func NewCaseProxy

func NewCaseProxy(testCase *testCase) *caseProxy

NewCaseProxy construct a new proxy for a special testcase Because the testcase is defined with e2e test and is a package-level variable, caseProxy enables isolation when referenced multiple times.

func NewFeatureCase

func NewFeatureCase(featureName string, caseSets ...CaseSet) *featureCase

NewFeatureCase construct a new subFeature case

func NewFunctionCase

func NewFunctionCase(functionName string, featureCases ...*featureCase) *functionCase

NewFunctionCase construct a new feature case

func NewModuleCase

func NewModuleCase(moduleName string) *moduleCase

NewModuleCase construct a new module case

func NewTestCase

func NewTestCase(name string) *testCase

NewTestCase a construct new test case

func NewTestPoint

func NewTestPoint(name string) *testPoint

NewTestPoint construct a new test point

Types

type AddAssertionFunc

type AddAssertionFunc func(f interface{}) *testPoint

AddAssertionFunc helper function to make a implementation of CustomAssertion interface

func (AddAssertionFunc) AddAssertion

func (p AddAssertionFunc) AddAssertion(f interface{}) *testPoint

AddAssertion add a custom assertion

type CaseLinker

type CaseLinker interface {
	// LinkParentNode link test case to parent node
	LinkParentNode(node *Node)
}

CaseLinker describe a interface to link test case to parent node

type CaseSet

type CaseSet interface {
	CaseLinker

	// Focus specify the test points to be executed
	Focus(testPoints ...*testPoint) CaseSet

	// Optional mark the test as optional
	Optional() CaseSet
}

CaseSet describe a set of test cases

type CaseSetFactory

type CaseSetFactory interface {
	// New construct a new case set
	New() CaseSet
}

CaseSetFactory factory to create a case set

type CustomAssertion

type CustomAssertion interface {
	// AddAssertion add a custom assertion
	AddAssertion(f interface{}) *testPoint
}

CustomAssertion describe a interface to add custom assertion for a special testpoint

type LabelLevel

type LabelLevel string

LabelLevel is the level of the label

const (
	ModuleLevel    LabelLevel = "module"
	FunctionLevel  LabelLevel = "function"
	FeatureLevel   LabelLevel = "feature"
	TestCaseLevel  LabelLevel = "testcase"
	TestPointLevel LabelLevel = "testpoint"
)

type LevelLabel

type LevelLabel struct {
	Level LabelLevel `json:"level" yaml:"level"`
	Name  string     `json:"name" yaml:"name"`
}

LevelLabel describe the label of the test node contains level and name

func NewFeatureLabel

func NewFeatureLabel(name string) *LevelLabel

func NewFunctionLabel

func NewFunctionLabel(name string) *LevelLabel

func NewModuleLabel

func NewModuleLabel(name string) *LevelLabel

func (LevelLabel) Labels

func (t LevelLabel) Labels() Labels

Labels return the ginkgo-labels format of the label

func (LevelLabel) String

func (t LevelLabel) String() string

String return the string format of the label

type Node

type Node struct {
	*LevelLabel `json:",inline" yaml:",inline"`
	Description string `json:"description" yaml:"description"`

	ParentNode *Node   `json:"parentNode,omitempty" yaml:"parentNode,omitempty"`
	SubNodes   []*Node `json:"subNodes" yaml:"subNodes"`
	// contains filtered or unexported fields
}

Node is the basic unit of the test case set each node can only have one parent node, but can have multiple sub nodes

func NewNode

func NewNode(level LabelLevel, name string) *Node

func (*Node) AddAdditionalLabels

func (n *Node) AddAdditionalLabels(labels Labels)

AddAdditionalLabels add additional labels to the node

func (*Node) AdditionalLabels

func (n *Node) AdditionalLabels() Labels

AdditionalLabels return the additional labels of the node

func (*Node) Clone

func (n *Node) Clone() *Node

Clone deep clone the node and sub nodes

func (*Node) Equal

func (n *Node) Equal(other *Node) bool

Equal check if two nodes are equal

func (*Node) FullPathLabels

func (n *Node) FullPathLabels() Labels

FullPathLabels return all the full path from current node to the leaf node

func (*Node) IdentifyLabels

func (n *Node) IdentifyLabels() Labels

IdentifyLabels return the unique labels of the current node

func (*Node) Labels

func (n *Node) Labels() Labels

Labels return all the labels contains all parent node labels and current node labels

func (*Node) LinkParentNode

func (n *Node) LinkParentNode(parentNode *Node)

LinkParentNode link current node to a parent node

func (*Node) RegisterTestCase

func (n *Node) RegisterTestCase()

RegisterTestCase iterate over the node tree, register all the test case to ginkgo

Jump to

Keyboard shortcuts

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