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

internaltesting

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialsContext added in v0.2.0

type CredentialsContext struct {
	// OpenAIValid, AWSValid, AzureValid are true if the credentials are set and ready to use the real services.
	OpenAIValid, AWSValid, AzureValid bool
	// OpenAIAPIKey is the OpenAI API key. This defaults to "dummy-openai-api-key" if not set.
	OpenAIAPIKey string
	// OpenAIAPIKeyFilePath is the path to the temporary file containing the OpenAIAPIKey.
	OpenAIAPIKeyFilePath string
	// AWSFileLiteral contains the AWS credentials in the format of a file literal.
	AWSFileLiteral string
	// AWSFilePath is the path to the temporary file containing the AWS credentials (or dummy credentials).
	AWSFilePath string
	// AzureAccessToken is the Azure access token. This defaults to "dummy-azure-access-token" if not set.
	AzureAccessToken string
	// AzureAccessTokenFilePath is the path to the temporary file containing the Azure access token (or dummy token).
	AzureAccessTokenFilePath string
}

CredentialsContext holds the context for the credentials used in the tests.

func RequireNewCredentialsContext added in v0.2.0

func RequireNewCredentialsContext(t *testing.T) (ctx CredentialsContext)

RequireNewCredentialsContext creates a new credential context for the tests from the environment variables.

func (CredentialsContext) MaybeSkip added in v0.2.0

func (c CredentialsContext) MaybeSkip(t *testing.T, required RequiredCredential)

MaybeSkip skips the test if the required credentials are not set.

type NewControllerEventChanImpl added in v0.2.0

type NewControllerEventChanImpl[T client.Object] struct {
	Ch chan event.GenericEvent
}

NewControllerEventChanImpl is a test implementation of the controller event channels that are used in the cross-controller communication.

func NewControllerEventChan added in v0.2.0

func NewControllerEventChan[T client.Object]() *NewControllerEventChanImpl[T]

NewControllerEventChan creates a new SyncFnImpl.

func (*NewControllerEventChanImpl[T]) RequireItemsEventually added in v0.2.0

func (s *NewControllerEventChanImpl[T]) RequireItemsEventually(t *testing.T, exp int) []T

RequireItemsEventually returns a copy of the items.

type RequiredCredential added in v0.2.0

type RequiredCredential byte

RequiredCredential is a bit flag for the required credentials.

const (
	// RequiredCredentialOpenAI is the bit flag for the OpenAI API key.
	RequiredCredentialOpenAI RequiredCredential = 1 << iota
	// RequiredCredentialAWS is the bit flag for the AWS credentials.
	RequiredCredentialAWS
	// RequiredCredentialAzure is the bit flag for the Azure access token.
	RequiredCredentialAzure
)

Jump to

Keyboard shortcuts

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