Documentation ¶
Overview ¶
Package conformance is a framework for conformance test
Index ¶
- Variables
- func GlobalModuleCaseLabels() Labels
- func NewCaseProxy(testCase *testCase) *caseProxy
- func NewFeatureCase(featureName string, caseSets ...CaseSet) *featureCase
- func NewFunctionCase(functionName string, featureCases ...*featureCase) *functionCase
- func NewModuleCase(moduleName string) *moduleCase
- func NewTestCase(name string) *testCase
- func NewTestPoint(name string) *testPoint
- type AddAssertionFunc
- type CaseLinker
- type CaseSet
- type CaseSetFactory
- type CustomAssertion
- type LabelLevel
- type LevelLabel
- type Node
- func (n *Node) AddAdditionalLabels(labels Labels)
- func (n *Node) AdditionalLabels() Labels
- func (n *Node) Clone() *Node
- func (n *Node) Equal(other *Node) bool
- func (n *Node) FullPathLabels() Labels
- func (n *Node) IdentifyLabels() Labels
- func (n *Node) Labels() Labels
- func (n *Node) LinkParentNode(parentNode *Node)
- func (n *Node) RegisterTestCase()
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 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 an 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 // contains filtered or unexported methods }
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) 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 ¶
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