Documentation
¶
Index ¶
- Constants
- func AreSharedDependenciesInstalled() bool
- func GetFrameworkRegistry() *sync.Map
- func InstallSharedDependencies()
- func UninstallSharedDependencies()
- type DeploymentInfo
- type Framework
- func FromContext(ctx context.Context) *Framework
- func FromReportEntries(entries []types.ReportEntry) *Framework
- func GetRegisteredFramework(namespace string) (*Framework, bool)
- func NewFramework(namespace string) *Framework
- func NewUniqueFramework(baseName string) *Framework
- func Shared(namespace string) *Framework
- func (f *Framework) ApplyTestData(path string)
- func (f *Framework) ApplyTestDataWithVars(path string, vars map[string]string)
- func (f *Framework) ApplyTestDataWithoutNamespaceReplacement(path string)
- func (f *Framework) ApplyYAML(yamlContent string)
- func (f *Framework) AssertNoLogsContaining(podName, substring string, checkDuration time.Duration) error
- func (f *Framework) ClusterPipeline(name string) *assertions.PipelineResource
- func (f *Framework) CountPipelines() (int, error)
- func (f *Framework) CountServicesContaining(substring string) (int, error)
- func (f *Framework) CountServicesWithLabel(labelSelector string) int
- func (f *Framework) CountValidPipelines() (int, error)
- func (f *Framework) CreateMultiplePipelinesFromTemplate(templatePath, placeholder string, count int) time.Duration
- func (f *Framework) DeleteClusterResource(kind, name string)
- func (f *Framework) DeleteResource(kind, name string)
- func (f *Framework) DeleteTestData(path string)
- func (f *Framework) ExpectServiceExists(name string)
- func (f *Framework) ExportTestPlan()
- func (f *Framework) GetAgentPods(vectorName string) ([]string, error)
- func (f *Framework) GetAggregatorPods(aggregatorName string) ([]string, error)
- func (f *Framework) GetClusterPipelineAnnotation(name, annotationKey string) string
- func (f *Framework) GetClusterPipelineStatus(name, field string) string
- func (f *Framework) GetDeployment(name string) (*DeploymentInfo, error)
- func (f *Framework) GetPipelineAnnotation(name string, annotationKey string) string
- func (f *Framework) GetPipelineAnnotationInNamespace(name, namespace, annotationKey string) string
- func (f *Framework) GetPipelineStatus(name string, field string) string
- func (f *Framework) GetPodLogs(podName string) (string, error)
- func (f *Framework) GetPodLogsTail(podName string, lines int) (string, error)
- func (f *Framework) GetPodLogsWithOptions(podName string, opts LogOptions) (string, error)
- func (f *Framework) GetPodsByLabel(labelSelector string) ([]string, error)
- func (f *Framework) GetSecret(name string) (map[string][]byte, error)
- func (f *Framework) GetServicePort(name string) string
- func (f *Framework) Kubectl() *kubectl.Client
- func (f *Framework) Namespace() string
- func (f *Framework) Pipeline(name string) *assertions.PipelineResource
- func (f *Framework) PrintMetrics()
- func (f *Framework) RecordStep(step recorder.TestStep)
- func (f *Framework) Service(name string) *assertions.ServiceResource
- func (f *Framework) SetTestName(name string)
- func (f *Framework) Setup()
- func (f *Framework) Teardown()
- func (f *Framework) ToContext(ctx context.Context) context.Context
- func (f *Framework) TryGetServicePort(name string) (string, error)
- func (f *Framework) VerifyAgentHasClusterPipeline(vectorName, pipelineName string) error
- func (f *Framework) VerifyAgentHasPipeline(vectorName, pipelineName string) error
- func (f *Framework) VerifyAgentHasPipelineInNamespace(vectorName, pipelineName, namespace string) error
- func (f *Framework) VerifyAggregatorHasClusterPipeline(aggregatorName, pipelineName string) error
- func (f *Framework) VerifyAggregatorHasPipeline(aggregatorName, pipelineName string) error
- func (f *Framework) WaitForClusterPipelineInvalid(name string)
- func (f *Framework) WaitForClusterPipelineValid(name string)
- func (f *Framework) WaitForDeploymentReady(name string)
- func (f *Framework) WaitForLogsContaining(podName, substring string, timeout time.Duration) error
- func (f *Framework) WaitForLogsMatching(podName, pattern string, timeout time.Duration) error
- func (f *Framework) WaitForPipelineInvalid(name string)
- func (f *Framework) WaitForPipelineValid(name string)
- func (f *Framework) WaitForPipelineValidInNamespace(name, namespace string)
- func (f *Framework) WaitForPodReady(podName string)
- func (f *Framework) WaitForPodReadyInNamespace(podName, namespace string)
- func (f *Framework) WaitForServiceCount(labelSelector string, expectedCount int, timeout time.Duration)
- type FrameworkContextKey
- type LogOptions
- type SharedDependencies
- type TestMetrics
Constants ¶
const ( // MaxConfigSize is the maximum allowed size for base64-encoded config data (10MB) // This prevents DoS attacks via extremely large config payloads MaxConfigSize = 10 * 1024 * 1024 // 10MB )
Variables ¶
This section is empty.
Functions ¶
func AreSharedDependenciesInstalled ¶
func AreSharedDependenciesInstalled() bool
AreSharedDependenciesInstalled checks if shared dependencies are available
func GetFrameworkRegistry ¶
GetFrameworkRegistry returns the framework registry for iteration Used by ReportAfterEach to find frameworks when namespace is not known
func InstallSharedDependencies ¶
func InstallSharedDependencies()
InstallSharedDependencies installs Prometheus and cert-manager once for all tests This should be called in BeforeSuite
func UninstallSharedDependencies ¶
func UninstallSharedDependencies()
UninstallSharedDependencies removes Prometheus and cert-manager This should be called in AfterSuite
Types ¶
type DeploymentInfo ¶
DeploymentInfo contains simplified deployment information
type Framework ¶
type Framework struct {
TestDataPath string // Path to test data directory (configurable via E2E_TESTDATA_PATH)
// contains filtered or unexported fields
}
Framework provides a high-level API for e2e tests
func FromContext ¶
FromContext retrieves a framework from the given context Returns nil if no framework is stored in the context
func FromReportEntries ¶
func FromReportEntries(entries []types.ReportEntry) *Framework
FromReportEntries retrieves a framework from Ginkgo report entries This is the preferred way to access framework in ReportAfterEach Returns nil if no framework entry is found
func GetRegisteredFramework ¶
GetRegisteredFramework retrieves a framework by namespace Used by artifact collector to access kubectl client and namespace
func NewFramework ¶
NewFramework creates a new isolated test framework with its own namespace
func NewUniqueFramework ¶
NewUniqueFramework creates a new framework with a unique timestamped namespace This prevents namespace collisions when tests run in parallel or when cleanup is slow
func Shared ¶
Shared returns a shared framework instance that reuses the same namespace This is useful for parallel tests that don't interfere with each other
func (*Framework) ApplyTestData ¶
ApplyTestData loads and applies a test manifest from testdata directory It automatically replaces any hardcoded namespace with the framework's namespace
func (*Framework) ApplyTestDataWithVars ¶
ApplyTestDataWithVars loads and applies a test manifest with variable substitution
func (*Framework) ApplyTestDataWithoutNamespaceReplacement ¶
ApplyTestDataWithoutNamespaceReplacement loads and applies a test manifest WITHOUT namespace replacement Use this when you need to apply resources to specific namespaces
func (*Framework) AssertNoLogsContaining ¶
func (f *Framework) AssertNoLogsContaining(podName, substring string, checkDuration time.Duration) error
AssertNoLogsContaining verifies that a substring does NOT appear in pod logs Returns nil if substring is absent for the entire check duration, error otherwise
func (*Framework) ClusterPipeline ¶
func (f *Framework) ClusterPipeline(name string) *assertions.PipelineResource
ClusterPipeline returns a cluster-scoped pipeline resource wrapper for custom matchers
func (*Framework) CountPipelines ¶
CountPipelines returns the total number of pipelines in the namespace
func (*Framework) CountServicesContaining ¶
CountServicesContaining counts services whose name contains the given substring
func (*Framework) CountServicesWithLabel ¶
CountServicesWithLabel counts services matching a label selector
func (*Framework) CountValidPipelines ¶
CountValidPipelines counts how many pipelines are valid in the namespace
func (*Framework) CreateMultiplePipelinesFromTemplate ¶
func (f *Framework) CreateMultiplePipelinesFromTemplate(templatePath, placeholder string, count int) time.Duration
CreateMultiplePipelinesFromTemplate creates N pipelines from a template by replacing a placeholder
func (*Framework) DeleteClusterResource ¶
DeleteClusterResource deletes a cluster-scoped Kubernetes resource (no namespace)
func (*Framework) DeleteResource ¶
DeleteResource deletes a Kubernetes resource
func (*Framework) DeleteTestData ¶
DeleteTestData loads and deletes a test manifest from testdata directory It automatically replaces any hardcoded namespace with the framework's namespace
func (*Framework) ExpectServiceExists ¶
ExpectServiceExists verifies that a service exists
func (*Framework) ExportTestPlan ¶
func (f *Framework) ExportTestPlan()
ExportTestPlan exports the recorded test plan to files
func (*Framework) GetAgentPods ¶
GetAgentPods retrieves agent pod names
func (*Framework) GetAggregatorPods ¶
GetAggregatorPods retrieves aggregator pod names for a given aggregator
func (*Framework) GetClusterPipelineAnnotation ¶
GetClusterPipelineAnnotation retrieves a specific annotation from a ClusterVectorPipeline
func (*Framework) GetClusterPipelineStatus ¶
GetClusterPipelineStatus retrieves a specific status field from a ClusterVectorPipeline
func (*Framework) GetDeployment ¶
func (f *Framework) GetDeployment(name string) (*DeploymentInfo, error)
GetDeployment retrieves a Deployment by name in the framework's namespace
func (*Framework) GetPipelineAnnotation ¶
GetPipelineAnnotation retrieves a specific annotation from a pipeline
func (*Framework) GetPipelineAnnotationInNamespace ¶
GetPipelineAnnotationInNamespace retrieves a specific annotation from a pipeline in a specific namespace
func (*Framework) GetPipelineStatus ¶
GetPipelineStatus retrieves a specific status field from a pipeline
func (*Framework) GetPodLogs ¶
GetPodLogs retrieves logs from a pod
func (*Framework) GetPodLogsTail ¶
GetPodLogsTail retrieves the last N lines of logs from a pod
func (*Framework) GetPodLogsWithOptions ¶
func (f *Framework) GetPodLogsWithOptions(podName string, opts LogOptions) (string, error)
GetPodLogsWithOptions retrieves logs from a pod with custom options
func (*Framework) GetPodsByLabel ¶
GetPodsByLabel retrieves pod names matching a label selector
func (*Framework) GetServicePort ¶
GetServicePort retrieves the port of a service
func (*Framework) Pipeline ¶
func (f *Framework) Pipeline(name string) *assertions.PipelineResource
Pipeline returns a pipeline resource wrapper for custom matchers
func (*Framework) PrintMetrics ¶
func (f *Framework) PrintMetrics()
PrintMetrics prints timing metrics for the test
func (*Framework) RecordStep ¶
RecordStep records a test step for reproducibility
func (*Framework) Service ¶
func (f *Framework) Service(name string) *assertions.ServiceResource
Service returns a service resource wrapper for custom matchers
func (*Framework) SetTestName ¶
SetTestName sets the current test name in the recorder
func (*Framework) Teardown ¶
func (f *Framework) Teardown()
Teardown performs the test environment cleanup
func (*Framework) ToContext ¶
ToContext stores the framework in the given context This allows framework to be passed through context chains if needed
func (*Framework) TryGetServicePort ¶
TryGetServicePort retrieves the port of a service without failing if not found
func (*Framework) VerifyAgentHasClusterPipeline ¶
VerifyAgentHasClusterPipeline verifies that an agent Secret contains the specified ClusterVectorPipeline
func (*Framework) VerifyAgentHasPipeline ¶
VerifyAgentHasPipeline verifies that the agent Secret contains the specified pipeline
func (*Framework) VerifyAgentHasPipelineInNamespace ¶
func (f *Framework) VerifyAgentHasPipelineInNamespace(vectorName, pipelineName, namespace string) error
VerifyAgentHasPipelineInNamespace verifies that an agent Secret contains the specified pipeline from a specific namespace
func (*Framework) VerifyAggregatorHasClusterPipeline ¶
VerifyAggregatorHasClusterPipeline verifies that an aggregator Secret contains the specified ClusterVectorPipeline
func (*Framework) VerifyAggregatorHasPipeline ¶
VerifyAggregatorHasPipeline verifies that an aggregator Secret contains the specified pipeline
func (*Framework) WaitForClusterPipelineInvalid ¶
WaitForClusterPipelineInvalid waits for a ClusterVectorPipeline to become invalid (for negative tests)
func (*Framework) WaitForClusterPipelineValid ¶
WaitForClusterPipelineValid waits for a ClusterVectorPipeline to become valid
func (*Framework) WaitForDeploymentReady ¶
WaitForDeploymentReady waits for a deployment to be ready
func (*Framework) WaitForLogsContaining ¶
WaitForLogsContaining waits for a substring to appear in pod logs Returns nil if found, error if timeout occurs
func (*Framework) WaitForLogsMatching ¶
WaitForLogsMatching waits for a regex pattern to match in pod logs Returns nil if match found, error if timeout occurs or pattern is invalid
func (*Framework) WaitForPipelineInvalid ¶
WaitForPipelineInvalid waits for a pipeline to become invalid (for negative tests)
func (*Framework) WaitForPipelineValid ¶
WaitForPipelineValid waits for a pipeline to become valid
func (*Framework) WaitForPipelineValidInNamespace ¶
WaitForPipelineValidInNamespace waits for a pipeline to become valid in a specific namespace
func (*Framework) WaitForPodReady ¶
WaitForPodReady waits for a pod to become ready
func (*Framework) WaitForPodReadyInNamespace ¶
WaitForPodReadyInNamespace waits for a pod to become ready in a specific namespace
type FrameworkContextKey ¶
type FrameworkContextKey struct{}
FrameworkContextKey is the key type for storing Framework in context Using a custom type prevents collisions with other context keys
type LogOptions ¶
type LogOptions struct {
// Container name to get logs from (empty for default container)
Container string
// TailLines limits the number of lines from the end of the logs
TailLines int
// SinceSeconds returns logs newer than a relative duration (in seconds)
SinceSeconds int
}
LogOptions contains options for retrieving pod logs
type SharedDependencies ¶
type SharedDependencies struct {
// contains filtered or unexported fields
}
SharedDependencies manages dependencies that are shared across all tests