test

package
v1.1.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentTest

type ComponentTest struct {
	CreateFunc func(testing.TB) feature.PodTemplateManagers
	WantFunc   func(testing.TB, feature.PodTemplateManagers)
}

ComponentTest use to configure how to test a component (Cluster-Agent, Agent, ClusterChecksRunner)

func NewDefaultComponentTest

func NewDefaultComponentTest() *ComponentTest

NewDefaultComponentTest returns a default ComponentTest

func (*ComponentTest) WithCreateFunc

func (ct *ComponentTest) WithCreateFunc(f func(testing.TB) feature.PodTemplateManagers) *ComponentTest

WithCreateFunc sets CreateFunc

func (*ComponentTest) WithWantFunc

func (ct *ComponentTest) WithWantFunc(f func(testing.TB, feature.PodTemplateManagers)) *ComponentTest

WithWantFunc sets WantFunc

type FeatureTest

type FeatureTest struct {
	Name string
	// Inputs
	DDAv2   *v2alpha1.DatadogAgent
	DDAv1   *v1alpha1.DatadogAgent
	Options *Options
	// Dependencies Store
	StoreOption        *dependencies.StoreOptions
	StoreInitFunc      func(store dependencies.StoreClient)
	RequiredComponents feature.RequiredComponents
	// Test configuration
	Agent               *ComponentTest
	ClusterAgent        *ComponentTest
	ClusterChecksRunner *ComponentTest
	// Want
	WantConfigure             bool
	WantManageDependenciesErr bool
	WantDependenciesFunc      func(testing.TB, dependencies.StoreClient)
}

FeatureTest use to define a Feature test

type FeatureTestSuite

type FeatureTestSuite []FeatureTest

FeatureTestSuite use define several tests on a Feature how to define a test:

	func Test_MyFeature_(t *testing.T) {
		tests := test.FeatureTestSuite{}
  	tests.Run(t, myFeatureBuildFunc)
	}

func (FeatureTestSuite) Run

func (suite FeatureTestSuite) Run(t *testing.T, buildFunc feature.BuildFunc)

Run use to run the Feature test suite.

type Options

type Options struct{}

Options use to provide some option to the test.

Jump to

Keyboard shortcuts

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