Help us shape the future of Go! Take the 2026 Go Developer Survey

test

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 14 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, string)
	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, string)) *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
	DDA            *v2alpha1.DatadogAgent
	Options        *Options
	FeatureOptions *feature.Options
	// Dependencies Store
	StoreOption        *store.StoreOptions
	StoreInitFunc      func(store store.StoreClient)
	RequiredComponents feature.RequiredComponents
	// Test configuration
	Agent               *ComponentTest
	ClusterAgent        *ComponentTest
	ClusterChecksRunner *ComponentTest
	OtelAgentGateway    *ComponentTest
	// Want
	WantConfigure             bool
	WantManageDependenciesErr bool
	WantDependenciesFunc      func(testing.TB, store.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