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

internaltesting

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 8 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, GeminiValid, GroqValid, GrokValid, SambaNovaValid, DeepInfraValid bool
	// OpenAIAPIKey is the OpenAI API key. This defaults to "dummy-openai-api-key" if not set.
	OpenAIAPIKey string
	// AWSFileLiteral contains the AWS credentials in the format of a file literal.
	AWSFileLiteral     string
	AWSAccessKeyID     string
	AWSSecretAccessKey string
	// AzureAccessToken is the Azure access token. This defaults to "dummy-azure-access-token" if not set.
	AzureAccessToken string
	// GeminiAPIKey is the API key for Gemini API. https://ai.google.dev/gemini-api/docs/openai
	GeminiAPIKey string
	// GroqAPIKey is the API key for Groq API. https://console.groq.com/docs/openai
	GroqAPIKey string
	// GrokAPIKey is the API key for Grok API. https://console.grok.com/docs/openai
	GrokAPIKey string
	// SambaNovaAPIKey is the API key for SambaNova API. https://docs.sambanova.ai/cloud/api-reference/endpoints/chat
	SambaNovaAPIKey string
	// DeepInfraAPIKey is the API key for DeepInfra API. https://deepinfra.com/docs/openai_api
	DeepInfraAPIKey string
}

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

func RequireNewCredentialsContext added in v0.2.0

func RequireNewCredentialsContext() (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
	// RequiredCredentialGemini is the bit flag for the Gemini API key.
	RequiredCredentialGemini
	// RequiredCredentialGroq is the bit flag for the Groq API key.
	// https://console.groq.com/docs/openai
	RequiredCredentialGroq
	// RequiredCredentialGrok is the bit flag for the Grok API key.
	// https://console.groq.com/docs/openai
	RequiredCredentialGrok
	// RequiredCredentialSambaNova is the bit flag for the SambaNova API key.
	// https://docs.sambanova.ai/cloud/api-reference/endpoints/chat
	RequiredCredentialSambaNova
	// RequiredCredentialDeepInfra is the bit flag for the DeepInfra API key.
	// https://deepinfra.com/docs/openai_api
	RequiredCredentialDeepInfra
)

Directories

Path Synopsis
Package testotel provides test utilities for OpenTelemetry tracing tests.
Package testotel provides test utilities for OpenTelemetry tracing tests.

Jump to

Keyboard shortcuts

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