operator_test

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package operator_test provides end-to-end tests for the ToolHive operator controllers. This package tests MCPRegistry and other operator functionality using Ginkgo and Kubernetes APIs.

Index

Constants

View Source
const (
	// QuickTimeout for operations that should complete quickly (e.g., resource creation)
	QuickTimeout = 10 * time.Second

	// MediumTimeout for operations that may take some time (e.g., controller reconciliation)
	MediumTimeout = 30 * time.Second

	// LongTimeout for operations that may take a while (e.g., sync operations)
	LongTimeout = 2 * time.Minute

	// ExtraLongTimeout for operations that may take very long (e.g., complex e2e scenarios)
	ExtraLongTimeout = 5 * time.Minute

	// DefaultPollingInterval for Eventually/Consistently checks
	DefaultPollingInterval = 1 * time.Second

	// FastPollingInterval for operations that need frequent checks
	FastPollingInterval = 200 * time.Millisecond

	// SlowPollingInterval for operations that don't need frequent checks
	SlowPollingInterval = 5 * time.Second
)

Common timeout values for different types of operations

Variables

This section is empty.

Functions

func AddManualSyncTrigger

func AddManualSyncTrigger(mcpRegistry *mcpv1alpha1.MCPRegistry, triggerValue string, syncTriggerAnnotation string)

AddManualSyncTrigger adds a manual sync trigger annotation to an MCPRegistry

func CreateBasicMCPRegistrySpec

func CreateBasicMCPRegistrySpec(displayName, configMapName string,
	syncPolicy *mcpv1alpha1.SyncPolicy) mcpv1alpha1.MCPRegistrySpec

CreateBasicMCPRegistrySpec creates a basic MCPRegistry spec for testing

func CreateMCPRegistryManualOnly

func CreateMCPRegistryManualOnly(name, namespace, displayName, configMapName string) *mcpv1alpha1.MCPRegistry

CreateMCPRegistryManualOnly creates an MCPRegistry without automatic sync policy (manual only)

func CreateMCPRegistryWithGitSource

func CreateMCPRegistryWithGitSource(
	name, namespace, displayName, repository,
	branch, path, interval string) *mcpv1alpha1.MCPRegistry

CreateMCPRegistryWithGitSource creates an MCPRegistry with Git source and automatic sync policy

func CreateMCPRegistryWithSyncPolicy

func CreateMCPRegistryWithSyncPolicy(name, namespace, displayName, configMapName, interval string) *mcpv1alpha1.MCPRegistry

CreateMCPRegistryWithSyncPolicy creates an MCPRegistry with automatic sync policy

func UpdateConfigMapWithServers

func UpdateConfigMapWithServers(configMap *corev1.ConfigMap, servers []RegistryServer) error

UpdateConfigMapWithServers updates a ConfigMap with new server data

Types

type ConfigMapBuilder

type ConfigMapBuilder struct {
	// contains filtered or unexported fields
}

ConfigMapBuilder provides a fluent interface for building ConfigMaps

func (*ConfigMapBuilder) Build

func (cb *ConfigMapBuilder) Build() *corev1.ConfigMap

Build returns the constructed ConfigMap

func (*ConfigMapBuilder) Create

Create builds and creates the ConfigMap in the cluster

func (*ConfigMapBuilder) WithData

func (cb *ConfigMapBuilder) WithData(key, value string) *ConfigMapBuilder

WithData adds arbitrary data to the ConfigMap

func (*ConfigMapBuilder) WithLabel

func (cb *ConfigMapBuilder) WithLabel(key, value string) *ConfigMapBuilder

WithLabel adds a label to the ConfigMap

func (*ConfigMapBuilder) WithToolHiveRegistry

func (cb *ConfigMapBuilder) WithToolHiveRegistry(key string, servers []RegistryServer) *ConfigMapBuilder

WithToolHiveRegistry adds ToolHive format registry data

func (*ConfigMapBuilder) WithUpstreamRegistry

func (cb *ConfigMapBuilder) WithUpstreamRegistry(key string, servers map[string]RegistryServer) *ConfigMapBuilder

WithUpstreamRegistry adds upstream MCP format registry data

type ConfigMapTestHelper

type ConfigMapTestHelper struct {
	Client    client.Client
	Context   context.Context
	Namespace string
}

ConfigMapTestHelper provides utilities for ConfigMap testing and validation

func NewConfigMapTestHelper

func NewConfigMapTestHelper(ctx context.Context, k8sClient client.Client, namespace string) *ConfigMapTestHelper

NewConfigMapTestHelper creates a new test helper for ConfigMap operations

func (*ConfigMapTestHelper) CleanupConfigMaps

func (h *ConfigMapTestHelper) CleanupConfigMaps() error

CleanupConfigMaps deletes all test ConfigMaps in the namespace

func (*ConfigMapTestHelper) CreateSampleToolHiveRegistry

func (h *ConfigMapTestHelper) CreateSampleToolHiveRegistry(name string) (*corev1.ConfigMap, int)

CreateSampleToolHiveRegistry creates a ConfigMap with sample ToolHive registry data

func (*ConfigMapTestHelper) DeleteConfigMap

func (h *ConfigMapTestHelper) DeleteConfigMap(name string) error

DeleteConfigMap deletes a ConfigMap by name

func (*ConfigMapTestHelper) GetConfigMap

func (h *ConfigMapTestHelper) GetConfigMap(name string) (*corev1.ConfigMap, error)

GetConfigMap retrieves a ConfigMap by name

func (*ConfigMapTestHelper) ListConfigMaps

func (h *ConfigMapTestHelper) ListConfigMaps() (*corev1.ConfigMapList, error)

ListConfigMaps returns all ConfigMaps in the namespace

func (*ConfigMapTestHelper) NewConfigMapBuilder

func (h *ConfigMapTestHelper) NewConfigMapBuilder(name string) *ConfigMapBuilder

NewConfigMapBuilder creates a new ConfigMap builder

func (*ConfigMapTestHelper) UpdateConfigMap

func (h *ConfigMapTestHelper) UpdateConfigMap(configMap *corev1.ConfigMap) error

UpdateConfigMap updates an existing ConfigMap

type GitTestHelper

type GitTestHelper struct {
	// contains filtered or unexported fields
}

GitTestHelper manages Git repositories for testing

func NewGitTestHelper

func NewGitTestHelper(ctx context.Context) *GitTestHelper

NewGitTestHelper creates a new Git test helper

func (*GitTestHelper) CleanupRepositories

func (g *GitTestHelper) CleanupRepositories() error

CleanupRepositories removes all test repositories

func (*GitTestHelper) CommitRegistryData

func (g *GitTestHelper) CommitRegistryData(
	repo *GitTestRepository, filename string, servers []RegistryServer, commitMessage string)

CommitRegistryData commits registry data to the specified file in the repository

func (*GitTestHelper) CommitRegistryDataAtPath

func (g *GitTestHelper) CommitRegistryDataAtPath(
	repo *GitTestRepository, filePath string, servers []RegistryServer, commitMessage string)

CommitRegistryDataAtPath commits registry data to a nested path in the repository

func (*GitTestHelper) CreateBranch

func (g *GitTestHelper) CreateBranch(repo *GitTestRepository, branchName string)

CreateBranch creates a new branch and switches to it

func (*GitTestHelper) CreateRepository

func (g *GitTestHelper) CreateRepository(name string) *GitTestRepository

CreateRepository creates a new Git repository for testing

func (*GitTestHelper) SwitchBranch

func (g *GitTestHelper) SwitchBranch(repo *GitTestRepository, branchName string)

SwitchBranch switches to an existing branch

type GitTestRepository

type GitTestRepository struct {
	Name     string
	Path     string
	CloneURL string
}

GitTestRepository represents a test Git repository

type K8sResourceTestHelper

type K8sResourceTestHelper struct {
	// contains filtered or unexported fields
}

K8sResourceTestHelper provides utilities for testing Kubernetes resources

func NewK8sResourceTestHelper

func NewK8sResourceTestHelper(ctx context.Context, k8sClient client.Client, namespace string) *K8sResourceTestHelper

NewK8sResourceTestHelper creates a new test helper for Kubernetes resources

func (*K8sResourceTestHelper) DeploymentExists

func (h *K8sResourceTestHelper) DeploymentExists(name string) bool

DeploymentExists checks if a deployment exists

func (*K8sResourceTestHelper) GetConfigMap

func (h *K8sResourceTestHelper) GetConfigMap(name string) (*corev1.ConfigMap, error)

GetConfigMap retrieves a configmap by name

func (*K8sResourceTestHelper) GetDeployment

func (h *K8sResourceTestHelper) GetDeployment(name string) (*appsv1.Deployment, error)

GetDeployment retrieves a deployment by name

func (*K8sResourceTestHelper) GetService

func (h *K8sResourceTestHelper) GetService(name string) (*corev1.Service, error)

GetService retrieves a service by name

func (*K8sResourceTestHelper) IsDeploymentReady

func (h *K8sResourceTestHelper) IsDeploymentReady(name string) bool

IsDeploymentReady checks if a deployment is ready (all replicas available)

func (*K8sResourceTestHelper) ServiceExists

func (h *K8sResourceTestHelper) ServiceExists(name string) bool

ServiceExists checks if a service exists

type MCPRegistryTemplate

type MCPRegistryTemplate struct {
	NamePrefix      string
	ConfigMapPrefix string
	SyncInterval    string
	Format          string
	Labels          map[string]string
	Annotations     map[string]string
	ServerCount     int
	WithSyncPolicy  bool
	WithFilter      bool
}

MCPRegistryTemplate represents a template for creating MCPRegistry instances

type MCPRegistryTestHelper

type MCPRegistryTestHelper struct {
	Client    client.Client
	Context   context.Context
	Namespace string
}

MCPRegistryTestHelper provides specialized utilities for MCPRegistry testing

func NewMCPRegistryTestHelper

func NewMCPRegistryTestHelper(ctx context.Context, k8sClient client.Client, namespace string) *MCPRegistryTestHelper

NewMCPRegistryTestHelper creates a new test helper for MCPRegistry operations

func (*MCPRegistryTestHelper) CleanupRegistries

func (h *MCPRegistryTestHelper) CleanupRegistries() error

CleanupRegistries deletes all MCPRegistries in the namespace

func (*MCPRegistryTestHelper) CreateBasicConfigMapRegistry

func (h *MCPRegistryTestHelper) CreateBasicConfigMapRegistry(name, configMapName string) *mcpv1alpha1.MCPRegistry

CreateBasicConfigMapRegistry creates a simple MCPRegistry with ConfigMap source

func (*MCPRegistryTestHelper) CreateManualSyncRegistry

func (h *MCPRegistryTestHelper) CreateManualSyncRegistry(name, configMapName string) *mcpv1alpha1.MCPRegistry

CreateManualSyncRegistry creates an MCPRegistry with manual sync only

func (*MCPRegistryTestHelper) CreateUpstreamFormatRegistry

func (h *MCPRegistryTestHelper) CreateUpstreamFormatRegistry(name, configMapName string) *mcpv1alpha1.MCPRegistry

CreateUpstreamFormatRegistry creates an MCPRegistry with upstream format

func (*MCPRegistryTestHelper) DeleteRegistry

func (h *MCPRegistryTestHelper) DeleteRegistry(name string) error

DeleteRegistry deletes an MCPRegistry by name

func (*MCPRegistryTestHelper) GetRegistry

func (h *MCPRegistryTestHelper) GetRegistry(name string) (*mcpv1alpha1.MCPRegistry, error)

GetRegistry retrieves an MCPRegistry by name

func (*MCPRegistryTestHelper) GetRegistryCondition

func (h *MCPRegistryTestHelper) GetRegistryCondition(name, conditionType string) (*metav1.Condition, error)

GetRegistryCondition returns a specific condition from the registry status

func (*MCPRegistryTestHelper) GetRegistryPhase

func (h *MCPRegistryTestHelper) GetRegistryPhase(name string) (mcpv1alpha1.MCPRegistryPhase, error)

GetRegistryPhase returns the current phase of an MCPRegistry

func (*MCPRegistryTestHelper) GetRegistryStatus

func (h *MCPRegistryTestHelper) GetRegistryStatus(name string) (*mcpv1alpha1.MCPRegistryStatus, error)

GetRegistryStatus returns the current status of an MCPRegistry

func (*MCPRegistryTestHelper) ListRegistries

func (h *MCPRegistryTestHelper) ListRegistries() (*mcpv1alpha1.MCPRegistryList, error)

ListRegistries returns all MCPRegistries in the namespace

func (*MCPRegistryTestHelper) NewRegistryBuilder

func (h *MCPRegistryTestHelper) NewRegistryBuilder(name string) *RegistryBuilder

NewRegistryBuilder creates a new MCPRegistry builder

func (*MCPRegistryTestHelper) PatchRegistry

func (h *MCPRegistryTestHelper) PatchRegistry(name string, patch client.Patch) error

PatchRegistry patches an MCPRegistry with the given patch

func (*MCPRegistryTestHelper) TriggerManualSync

func (h *MCPRegistryTestHelper) TriggerManualSync(name string) error

TriggerManualSync adds the manual sync annotation to trigger a sync

func (*MCPRegistryTestHelper) UpdateRegistry

func (h *MCPRegistryTestHelper) UpdateRegistry(registry *mcpv1alpha1.MCPRegistry) error

UpdateRegistry updates an existing MCPRegistry

func (*MCPRegistryTestHelper) WaitForRegistryInitialization

func (h *MCPRegistryTestHelper) WaitForRegistryInitialization(registryName string,
	timingHelper *TimingTestHelper, statusHelper *StatusTestHelper)

WaitForRegistryInitialization waits for common initialization steps after registry creation: 1. Wait for finalizer to be added 2. Wait for controller to process the registry into an acceptable initial phase

type RegistryBuilder

type RegistryBuilder struct {
	// contains filtered or unexported fields
}

RegistryBuilder provides a fluent interface for building MCPRegistry objects

func (*RegistryBuilder) Build

Build returns the constructed MCPRegistry

func (*RegistryBuilder) Create

Create builds and creates the MCPRegistry in the cluster

func (*RegistryBuilder) WithAnnotation

func (rb *RegistryBuilder) WithAnnotation(key, value string) *RegistryBuilder

WithAnnotation adds an annotation to the registry

func (*RegistryBuilder) WithConfigMapSource

func (rb *RegistryBuilder) WithConfigMapSource(configMapName, key string) *RegistryBuilder

WithConfigMapSource configures the registry with a ConfigMap source

func (*RegistryBuilder) WithLabel

func (rb *RegistryBuilder) WithLabel(key, value string) *RegistryBuilder

WithLabel adds a label to the registry

func (*RegistryBuilder) WithNameExcludeFilter

func (rb *RegistryBuilder) WithNameExcludeFilter(patterns []string) *RegistryBuilder

WithNameExcludeFilter sets name exclude patterns for filtering

func (*RegistryBuilder) WithNameIncludeFilter

func (rb *RegistryBuilder) WithNameIncludeFilter(patterns []string) *RegistryBuilder

WithNameIncludeFilter sets name include patterns for filtering

func (*RegistryBuilder) WithSyncPolicy

func (rb *RegistryBuilder) WithSyncPolicy(interval string) *RegistryBuilder

WithSyncPolicy configures the sync policy

func (*RegistryBuilder) WithTagExcludeFilter

func (rb *RegistryBuilder) WithTagExcludeFilter(tags []string) *RegistryBuilder

WithTagExcludeFilter sets tag exclude patterns for filtering

func (*RegistryBuilder) WithTagIncludeFilter

func (rb *RegistryBuilder) WithTagIncludeFilter(tags []string) *RegistryBuilder

WithTagIncludeFilter sets tag include patterns for filtering

func (*RegistryBuilder) WithUpstreamFormat

func (rb *RegistryBuilder) WithUpstreamFormat() *RegistryBuilder

WithUpstreamFormat configures the registry to use upstream MCP format

type RegistryServer

type RegistryServer struct {
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	Tier        string   `json:"tier"`
	Status      string   `json:"status"`
	Transport   string   `json:"transport"`
	Tools       []string `json:"tools"`
	Image       string   `json:"image"`
	Tags        []string `json:"tags,omitempty"`
}

RegistryServer represents a server definition in the registry

func CreateComplexTestServers

func CreateComplexTestServers() []RegistryServer

CreateComplexTestServers creates complex test server data with multiple server types

func CreateOriginalTestServers

func CreateOriginalTestServers() []RegistryServer

CreateOriginalTestServers creates the standard original test server data

func CreateUpdatedTestServers

func CreateUpdatedTestServers() []RegistryServer

CreateUpdatedTestServers creates the standard updated test server data

type StatusTestHelper

type StatusTestHelper struct {
	// contains filtered or unexported fields
}

StatusTestHelper provides utilities for MCPRegistry status testing and validation

func NewStatusTestHelper

func NewStatusTestHelper(ctx context.Context, k8sClient client.Client, namespace string) *StatusTestHelper

NewStatusTestHelper creates a new test helper for status operations

func (*StatusTestHelper) WaitForCondition

func (h *StatusTestHelper) WaitForCondition(registryName, conditionType string,
	expectedStatus metav1.ConditionStatus, timeout time.Duration)

WaitForCondition waits for a specific condition to have the expected status

func (*StatusTestHelper) WaitForConditionReason

func (h *StatusTestHelper) WaitForConditionReason(registryName, conditionType, expectedReason string, timeout time.Duration)

WaitForConditionReason waits for a condition to have a specific reason

func (*StatusTestHelper) WaitForLastSyncHash

func (h *StatusTestHelper) WaitForLastSyncHash(registryName string, timeout time.Duration)

WaitForLastSyncHash waits for the registry to have a non-empty last sync hash

func (*StatusTestHelper) WaitForLastSyncTime

func (h *StatusTestHelper) WaitForLastSyncTime(registryName string, afterTime time.Time, timeout time.Duration)

WaitForLastSyncTime waits for the registry to update its last sync time

func (*StatusTestHelper) WaitForManualSyncProcessed

func (h *StatusTestHelper) WaitForManualSyncProcessed(registryName, triggerValue string, timeout time.Duration)

WaitForManualSyncProcessed waits for a manual sync annotation to be processed

func (*StatusTestHelper) WaitForPhase

func (h *StatusTestHelper) WaitForPhase(registryName string, expectedPhase mcpv1alpha1.MCPRegistryPhase, timeout time.Duration)

WaitForPhase waits for an MCPRegistry to reach the specified phase

func (*StatusTestHelper) WaitForPhaseAny

func (h *StatusTestHelper) WaitForPhaseAny(registryName string,
	expectedPhases []mcpv1alpha1.MCPRegistryPhase, timeout time.Duration)

WaitForPhaseAny waits for an MCPRegistry to reach any of the specified phases

func (*StatusTestHelper) WaitForServerCount

func (h *StatusTestHelper) WaitForServerCount(registryName string, expectedCount int, timeout time.Duration)

WaitForServerCount waits for the registry to report a specific server count

func (*StatusTestHelper) WaitForSyncCompletion

func (h *StatusTestHelper) WaitForSyncCompletion(registryName string, timeout time.Duration)

WaitForSyncCompletion waits for a sync operation to complete (either success or failure)

type TestDataFactory

type TestDataFactory struct {
	Client    client.Client
	Context   context.Context
	Namespace string
}

TestDataFactory provides utilities for generating test data and resources

func NewTestDataFactory

func NewTestDataFactory(ctx context.Context, k8sClient client.Client, namespace string) *TestDataFactory

NewTestDataFactory creates a new test data factory

func (*TestDataFactory) CleanupTestScenarioResources

func (f *TestDataFactory) CleanupTestScenarioResources(resources *TestScenarioResources) error

CleanupTestScenarioResources cleans up all resources in a test scenario

func (*TestDataFactory) CommonTestScenarios

func (f *TestDataFactory) CommonTestScenarios() map[string]TestScenario

CommonTestScenarios returns a set of common test scenarios

func (*TestDataFactory) CreateMCPRegistryFromTemplate

func (f *TestDataFactory) CreateMCPRegistryFromTemplate(template MCPRegistryTemplate) (
	*mcpv1alpha1.MCPRegistry, *corev1.ConfigMap, error)

CreateMCPRegistryFromTemplate creates an MCPRegistry based on a template

func (*TestDataFactory) CreateTestConfigMap

func (f *TestDataFactory) CreateTestConfigMap(name, format string, serverCount int) (*corev1.ConfigMap, error)

CreateTestConfigMap creates a ConfigMap with test registry data

func (*TestDataFactory) CreateTestScenario

func (f *TestDataFactory) CreateTestScenario(scenario TestScenario) (*TestScenarioResources, error)

CreateTestScenario creates all resources for a test scenario

func (*TestDataFactory) CreateTestSecret

func (f *TestDataFactory) CreateTestSecret(name string, data map[string][]byte) (*corev1.Secret, error)

CreateTestSecret creates a test secret for authentication

func (*TestDataFactory) DefaultMCPRegistryTemplate

func (*TestDataFactory) DefaultMCPRegistryTemplate() MCPRegistryTemplate

DefaultMCPRegistryTemplate returns a default template for MCPRegistry creation

func (*TestDataFactory) GenerateTestServer

func (*TestDataFactory) GenerateTestServer(index int) RegistryServer

GenerateTestServer generates a single test server

func (*TestDataFactory) GenerateTestServers

func (f *TestDataFactory) GenerateTestServers(count int) []RegistryServer

GenerateTestServers generates a slice of test servers for ToolHive format

func (*TestDataFactory) GenerateTestServersMap

func (f *TestDataFactory) GenerateTestServersMap(count int) map[string]RegistryServer

GenerateTestServersMap generates a map of test servers for upstream format

func (*TestDataFactory) GenerateUniqueName

func (*TestDataFactory) GenerateUniqueName(prefix string) string

GenerateUniqueName generates a unique name with timestamp and random suffix

func (*TestDataFactory) RandomRegistryData

func (f *TestDataFactory) RandomRegistryData(serverCount int) []RegistryServer

RandomRegistryData generates random registry data for stress testing

type TestScenario

type TestScenario struct {
	Name        string
	Description string
	Registries  []MCPRegistryTemplate
	ConfigMaps  []string
	Secrets     []string
}

TestScenario represents a complete test scenario with multiple resources

type TestScenarioResources

type TestScenarioResources struct {
	Registries []*mcpv1alpha1.MCPRegistry
	ConfigMaps []*corev1.ConfigMap
	Secrets    []*corev1.Secret
}

TestScenarioResources holds all resources created for a test scenario

type TimeoutConfig

type TimeoutConfig struct {
	Timeout         time.Duration
	PollingInterval time.Duration
	Description     string
}

TimeoutConfig represents timeout configuration for different scenarios

type TimingTestHelper

type TimingTestHelper struct {
	Client  client.Client
	Context context.Context
}

TimingTestHelper provides utilities for timing and synchronization in async operations

func NewTimingTestHelper

func NewTimingTestHelper(ctx context.Context, k8sClient client.Client) *TimingTestHelper

NewTimingTestHelper creates a new test helper for timing operations

func (*TimingTestHelper) ConsistentlyWithTimeout

func (*TimingTestHelper) ConsistentlyWithTimeout(assertion func() interface{},
	duration, polling time.Duration) gomega.AsyncAssertion

ConsistentlyWithTimeout runs a Consistently check with custom timeout and polling

func (*TimingTestHelper) EnsureQuickStability

func (h *TimingTestHelper) EnsureQuickStability(assertion func() interface{}) gomega.AsyncAssertion

EnsureQuickStability ensures a condition remains stable for a short period

func (*TimingTestHelper) EnsureStableState

func (*TimingTestHelper) EnsureStableState(assertion func() interface{}, duration time.Duration) gomega.AsyncAssertion

EnsureStableState ensures a condition remains stable for a period

func (*TimingTestHelper) EventuallyWithTimeout

func (*TimingTestHelper) EventuallyWithTimeout(assertion func() interface{},
	timeout, polling time.Duration) gomega.AsyncAssertion

EventuallyWithTimeout runs an Eventually check with custom timeout and polling

func (*TimingTestHelper) GetTimeoutForOperation

func (*TimingTestHelper) GetTimeoutForOperation(operationType string) TimeoutConfig

GetTimeoutForOperation returns appropriate timeout configuration for different operation types

func (*TimingTestHelper) WaitForComplexOperation

func (*TimingTestHelper) WaitForComplexOperation(assertion func() interface{}) gomega.AsyncAssertion

WaitForComplexOperation waits for complex multi-step operations

func (*TimingTestHelper) WaitForControllerReconciliation

func (*TimingTestHelper) WaitForControllerReconciliation(assertion func() interface{}) gomega.AsyncAssertion

WaitForControllerReconciliation waits for controller to reconcile changes

func (*TimingTestHelper) WaitForResourceCreation

func (*TimingTestHelper) WaitForResourceCreation(assertion func() interface{}) gomega.AsyncAssertion

WaitForResourceCreation waits for a resource to be created with quick timeout

func (*TimingTestHelper) WaitForSyncOperation

func (*TimingTestHelper) WaitForSyncOperation(assertion func() interface{}) gomega.AsyncAssertion

WaitForSyncOperation waits for a sync operation to complete

func (*TimingTestHelper) WaitWithCustomTimeout

func (*TimingTestHelper) WaitWithCustomTimeout(assertion func() interface{}, config TimeoutConfig) gomega.AsyncAssertion

WaitWithCustomTimeout waits with custom timeout configuration

type ToolHiveRegistryData

type ToolHiveRegistryData struct {
	Version       string                    `json:"version"`
	LastUpdated   string                    `json:"last_updated"`
	Servers       map[string]RegistryServer `json:"servers"`
	RemoteServers map[string]RegistryServer `json:"remoteServers"`
}

ToolHiveRegistryData represents the ToolHive registry format

type UniqueNames

type UniqueNames struct {
	RegistryName  string
	ConfigMapName string
	Timestamp     int64
}

UniqueNames is a struct that contains unique names for test resources

func NewUniqueNames

func NewUniqueNames(prefix string) *UniqueNames

NewUniqueNames creates a new set of unique names for test resources

func (*UniqueNames) GenerateTriggerValue

func (u *UniqueNames) GenerateTriggerValue(operation string) string

GenerateTriggerValue generates a unique trigger value for manual sync

type UpstreamRegistryData

type UpstreamRegistryData struct {
	Servers map[string]RegistryServer `json:"servers"`
}

UpstreamRegistryData represents the upstream MCP registry format

Jump to

Keyboard shortcuts

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