test

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 19 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

func LinodeNodeClass

func LinodeNodeClass(overrides ...v1.LinodeNodeClass) *v1.LinodeNodeClass

func LinodeNodeClassWithoutLKE

func LinodeNodeClassWithoutLKE(overrides ...v1.LinodeNodeClass) *v1.LinodeNodeClass

LinodeNodeClassWithoutLKE creates a LinodeNodeClass configured for direct Linode instance tests. The mode (LKE vs instance) is controlled by the startup flag, not this nodeclass. This helper sets up appropriate defaults for instance mode testing (e.g., Image field).

func Options

func Options(overrides ...OptionsFields) *options.Options

func StartAsync added in v0.2.0

func StartAsync[T any](ctx context.Context, fn func(context.Context) T) (results <-chan T, cleanup func())

StartAsync runs fn in a goroutine and returns its buffered result channel. Defer cleanup to cancel the operation, discard any unread result, and wait for the goroutine to exit. The operation must honor context cancellation.

Types

type Environment

type Environment struct {
	// Mock
	Clock             *clock.FakeClock
	EventRecorder     *coretest.EventRecorder
	InstanceTypeStore *nodeoverlay.InstanceTypeStore

	// API
	LinodeAPI *fake.LinodeClient

	// Cache
	LinodeCache               *cache.Cache
	InstanceTypeCache         *cache.Cache
	InstanceCache             *cache.Cache
	OfferingCache             *cache.Cache
	NodePoolCache             *cache.Cache
	UnavailableOfferingsCache *linodecache.UnavailableOfferings
	ValidationCache           *cache.Cache

	// Providers
	InstanceTypesProvider *instancetype.DefaultProvider
	InstanceProvider      *instance.DefaultProvider
	InstanceTypesResolver *instancetype.DefaultResolver
	LKENodeProvider       *lke.DefaultProvider
}

func NewEnvironment

func NewEnvironment(ctx context.Context) *Environment

func (*Environment) NodeProvider

func (env *Environment) NodeProvider(ctx context.Context) instance.Provider

NodeProvider returns the appropriate provider based on the mode in context. For tests that need a specific provider, use InstanceProvider or LKENodeProvider directly.

func (*Environment) Reset

func (env *Environment) Reset()

func (*Environment) SetDefaults added in v0.1.4

func (env *Environment) SetDefaults()

type OptionsFields

type OptionsFields struct {
	ClusterName             *string
	ClusterEndpoint         *string
	ClusterRegion           *string
	VMMemoryOverheadPercent *float64
	Mode                    *string
}

type TestNodeClass

type TestNodeClass struct {
	v1.LinodeNodeClass
}

Jump to

Keyboard shortcuts

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