test

package
v1.32.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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