framework

package
v0.0.0-...-441ca72 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptanceTestSuite

type AcceptanceTestSuite struct {
	suite.Suite

	// Kubernetes clients
	K8sClient client.Client
	ClientSet *kubernetes.Clientset

	// Test configuration
	Namespace    string
	Timeout      time.Duration
	PollInterval time.Duration

	// Logging
	Logger *zap.Logger
	// contains filtered or unexported fields
}

AcceptanceTestSuite provides the base test suite for Phoenix acceptance tests

func (*AcceptanceTestSuite) CleanupExperiment

func (s *AcceptanceTestSuite) CleanupExperiment(name string)

CleanupExperiment deletes an experiment and waits for cleanup

func (*AcceptanceTestSuite) CollectMetrics

func (s *AcceptanceTestSuite) CollectMetrics(duration time.Duration) map[string]float64

CollectMetrics collects metrics for a given duration

func (*AcceptanceTestSuite) CreateExperiment

func (s *AcceptanceTestSuite) CreateExperiment(name, baselinePipeline, candidatePipeline string, targetNodes map[string]string) *phoenixv1alpha1.ExperimentCR

CreateExperiment creates an experiment and returns it

func (*AcceptanceTestSuite) CreateLoadSimulation

func (s *AcceptanceTestSuite) CreateLoadSimulation(name, experimentID, profile string, duration string) *phoenixv1alpha1.LoadSimulationJob

CreateLoadSimulation creates a load simulation job

func (*AcceptanceTestSuite) CreatePipeline

func (s *AcceptanceTestSuite) CreatePipeline(name, template string, config map[string]interface{}) *phoenixv1alpha1.PhoenixProcessPipeline

CreatePipeline creates a Phoenix process pipeline

func (*AcceptanceTestSuite) GenerateTestReport

func (s *AcceptanceTestSuite) GenerateTestReport(testName string, results map[string]interface{})

GenerateTestReport generates a test report

func (*AcceptanceTestSuite) SetupSuite

func (s *AcceptanceTestSuite) SetupSuite()

SetupSuite initializes the test suite

func (*AcceptanceTestSuite) TearDownSuite

func (s *AcceptanceTestSuite) TearDownSuite()

TearDownSuite cleans up after all tests

func (*AcceptanceTestSuite) ValidateMetrics

func (s *AcceptanceTestSuite) ValidateMetrics(metrics map[string]float64, criteria map[string]func(float64) bool)

ValidateMetrics validates that metrics meet expected criteria

func (*AcceptanceTestSuite) WaitForExperimentPhase

func (s *AcceptanceTestSuite) WaitForExperimentPhase(name string, expectedPhase phoenixv1alpha1.ExperimentPhase)

WaitForExperimentPhase waits for an experiment to reach a specific phase

func (*AcceptanceTestSuite) WaitForPipelineReady

func (s *AcceptanceTestSuite) WaitForPipelineReady(name string)

WaitForPipelineReady waits for a pipeline to be ready

type KPIResult

type KPIResult struct {
	Name        string      `json:"name"`
	Value       interface{} `json:"value"`
	Target      interface{} `json:"target"`
	Unit        string      `json:"unit"`
	Passed      bool        `json:"passed"`
	Description string      `json:"description"`
}

KPIResult represents a KPI measurement result

type KPISummary

type KPISummary struct {
	TotalMeasurements  int     `json:"total_measurements"`
	PassedMeasurements int     `json:"passed_measurements"`
	AverageValue       float64 `json:"average_value"`
	MinValue           float64 `json:"min_value"`
	MaxValue           float64 `json:"max_value"`
}

KPISummary summarizes KPI results across tests

type TestReport

type TestReport struct {
	TestName    string                 `json:"test_name"`
	TestID      string                 `json:"test_id"`
	Timestamp   time.Time              `json:"timestamp"`
	Duration    time.Duration          `json:"duration"`
	Passed      bool                   `json:"passed"`
	Results     map[string]interface{} `json:"results"`
	Errors      []string               `json:"errors,omitempty"`
	Environment map[string]string      `json:"environment"`
	KPIs        map[string]KPIResult   `json:"kpis,omitempty"`
}

TestReport represents the structure of an acceptance test report

func (*TestReport) Save

func (r *TestReport) Save(filepath string) error

Save saves the report to a file

type TestResult

type TestResult struct {
	TestName  string        `json:"test_name"`
	TestID    string        `json:"test_id"`
	Passed    bool          `json:"passed"`
	Duration  time.Duration `json:"duration"`
	Timestamp time.Time     `json:"timestamp"`
	Errors    []string      `json:"errors,omitempty"`
}

TestResult provides a summary of a single test

type TestSummary

type TestSummary struct {
	TotalTests    int                   `json:"total_tests"`
	PassedTests   int                   `json:"passed_tests"`
	FailedTests   int                   `json:"failed_tests"`
	TotalDuration time.Duration         `json:"total_duration"`
	StartTime     time.Time             `json:"start_time"`
	EndTime       time.Time             `json:"end_time"`
	KPISummary    map[string]KPISummary `json:"kpi_summary"`
	TestResults   []TestResult          `json:"test_results"`
}

TestSummary provides a summary of multiple test reports

Jump to

Keyboard shortcuts

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