Documentation
ΒΆ
Index ΒΆ
- Variables
- func ParseKeys(keys string) string
- func StripANSI(text string) string
- func TestEveryAssertionType(t *testing.T)
- type ANSIBuilder
- type ANSISequence
- type ActiveFailure
- type AdvancedAssertionEngine
- type AllocatedResources
- type Allocation
- type AllocationPattern
- type AllocationTracker
- type Anomaly
- type ApplicationState
- type Assertion
- type AssertionFunc
- type AssertionTestCases
- type AssertionType
- type BackoffStrategy
- type ColorInfo
- type ColorReport
- type ColorTracker
- type ComprehensiveTestReport
- type ConfigChange
- type ConfigSnapshot
- type ConfigTracker
- type ConfigValidationRule
- type CoverageReport
- type CrashScenario
- type CrashType
- type CriticalFailure
- type DataProvider
- type DebugCollector
- type DependencyEdge
- type DependencyGraph
- type DependencyNode
- type DependencyType
- type EnhancedTestCase
- type EnhancedTestContext
- type EscalationRule
- type EscapeKey
- type ExecutionCoordinator
- type ExecutionJob
- type ExecutionPhase
- type ExecutionPlan
- type ExecutionResult
- type ExecutionResults
- type ExecutionSummary
- type ExpectedError
- type ExpectedResult
- type FDInfo
- type FailureEvent
- type FailureHandler
- type FailureInfo
- type FailureReport
- type FailureType
- type FileOperation
- type FileSystemLimits
- type FileSystemWatcher
- type Frame
- type GlobalTestState
- type HealthReport
- type HealthTracker
- type IsolationLevel
- type LayoutType
- type LeakDetector
- type LeakThresholds
- type MemoryAnalyzer
- type MemoryInfo
- type MemoryLeak
- type MemorySnapshot
- type Metrics
- type Monitor
- type NetworkConnection
- type NetworkLimits
- type NetworkMonitor
- type NetworkTraffic
- type NodeStatus
- type ParallelExecutor
- type ParallelGroup
- type PerformanceCollector
- type PerformanceLimits
- type PerformanceMetrics
- type PerformanceReport
- type PhaseResults
- type Prerequisite
- type ProcessInfo
- type ProcessMetric
- type ProcessMonitor
- type ProgressTracker
- type Recommendation
- type RecoveryStep
- type RecoveryStrategy
- type ReportGenerator
- type ResourceAllocation
- type ResourceAllocationPlan
- type ResourceLimits
- type ResourceManager
- type ResourceRequirements
- type ResourceUsage
- type RetryCondition
- type RetryPolicy
- type RiskAssessment
- type RollbackOperation
- type SetupStep
- type SharedResourcePool
- type SideEffectCheck
- type Size
- type StateCheck
- type StateCheckpoint
- type StateInspector
- func (si *StateInspector) DetectAnomalies() []Anomaly
- func (si *StateInspector) GetApplicationState() ApplicationState
- func (si *StateInspector) StartInspection() error
- func (si *StateInspector) StopInspection() error
- func (si *StateInspector) ValidateState(validators map[string]StateValidator) error
- type StateValidator
- type Step
- type StepAction
- type StressTestConfig
- type SuccessCriterion
- type SuitePerformance
- type SuiteReport
- type SuiteResults
- type SuiteState
- type SuiteStatus
- type TeardownStep
- type Terminal
- func (t *Terminal) Close() error
- func (t *Terminal) ConfigureWatchdog(config WatchdogConfig)
- func (t *Terminal) Contains(text string) bool
- func (t *Terminal) ForceStop(reason string)
- func (t *Terminal) GetScreen() string
- func (t *Terminal) GetWatchdogStats() WatchdogStats
- func (t *Terminal) Health() HealthReport
- func (t *Terminal) IsHanging() bool
- func (t *Terminal) IsRunning() bool
- func (t *Terminal) NotContains(text string) bool
- func (t *Terminal) Resize(width, height int) error
- func (t *Terminal) Screenshot() string
- func (t *Terminal) SendKeys(keys string) error
- func (t *Terminal) SendRaw(data []byte) error
- func (t *Terminal) SetLogFile(path string) error
- func (t *Terminal) SetTimeouts(globalTimeout, operationTimeout time.Duration)
- func (t *Terminal) Start(command string, args ...string) error
- func (t *Terminal) StartRecording()
- func (t *Terminal) StopRecording() []Frame
- func (t *Terminal) VerifyColors() ColorReport
- func (t *Terminal) VerifyLayout(layout LayoutType) bool
- func (t *Terminal) Wait(duration time.Duration)
- func (t *Terminal) WithTimeout(operation string, timeout time.Duration, fn func() error) error
- type TestCase
- type TestContext
- type TestDataSet
- type TestOrchestrator
- type TestPerformanceMonitor
- type TestResult
- type TestResults
- type TestStateManager
- type TestSuite
- type TestWorker
- type TraceCollector
- type TriggerCondition
- type VisualComparator
- type Watchdog
- func (w *Watchdog) Configure(config WatchdogConfig)
- func (w *Watchdog) Emergency(reason string)
- func (w *Watchdog) EndOperation()
- func (w *Watchdog) GetStats() WatchdogStats
- func (w *Watchdog) SafeRead(buf []byte, timeout time.Duration) (int, error)
- func (w *Watchdog) SafeWrite(data []byte, timeout time.Duration) error
- func (w *Watchdog) Start()
- func (w *Watchdog) StartOperation(operation string)
- func (w *Watchdog) Stop()
- func (w *Watchdog) UpdateActivity()
- func (w *Watchdog) WithTimeout(operation string, timeout time.Duration, fn func() error) error
- type WatchdogConfig
- type WatchdogStats
- type WorkerPerformance
- type WorkerPool
- type WorkerStatus
Constants ΒΆ
This section is empty.
Variables ΒΆ
var ( SizeWatch = Size{25, 10} // Smartwatch SizeMobile = Size{50, 20} // Mobile phone SizeTablet = Size{80, 30} // Tablet SizeDesktop = Size{120, 40} // Desktop SizeWide = Size{200, 50} // Wide desktop )
Common terminal sizes for testing
var KeyMap = map[string]string{
"<Ctrl+A>": "\x01",
"<Ctrl+B>": "\x02",
"<Ctrl+C>": "\x03",
"<Ctrl+D>": "\x04",
"<Ctrl+E>": "\x05",
"<Ctrl+F>": "\x06",
"<Ctrl+G>": "\x07",
"<Ctrl+H>": "\x08",
"<Ctrl+I>": "\x09",
"<Ctrl+J>": "\x0A",
"<Ctrl+K>": "\x0B",
"<Ctrl+L>": "\x0C",
"<Ctrl+M>": "\x0D",
"<Ctrl+N>": "\x0E",
"<Ctrl+O>": "\x0F",
"<Ctrl+P>": "\x10",
"<Ctrl+Q>": "\x11",
"<Ctrl+R>": "\x12",
"<Ctrl+S>": "\x13",
"<Ctrl+T>": "\x14",
"<Ctrl+U>": "\x15",
"<Ctrl+V>": "\x16",
"<Ctrl+W>": "\x17",
"<Ctrl+X>": "\x18",
"<Ctrl+Y>": "\x19",
"<Ctrl+Z>": "\x1A",
"<Enter>": "\r",
"<Return>": "\r",
"<Tab>": "\t",
"<Backspace>": "\x7F",
"<Delete>": "\x1B[3~",
"<Esc>": "\x1B",
"<Escape>": "\x1B",
"<Space>": " ",
"<Up>": "\x1B[A",
"<Down>": "\x1B[B",
"<Right>": "\x1B[C",
"<Left>": "\x1B[D",
"<Home>": "\x1B[H",
"<End>": "\x1B[F",
"<PgUp>": "\x1B[5~",
"<PgDown>": "\x1B[6~",
"<PageUp>": "\x1B[5~",
"<PageDown>": "\x1B[6~",
"<F1>": "\x1BOP",
"<F2>": "\x1BOQ",
"<F3>": "\x1BOR",
"<F4>": "\x1BOS",
"<F5>": "\x1B[15~",
"<F6>": "\x1B[17~",
"<F7>": "\x1B[18~",
"<F8>": "\x1B[19~",
"<F9>": "\x1B[20~",
"<F10>": "\x1B[21~",
"<F11>": "\x1B[23~",
"<F12>": "\x1B[24~",
"<Alt+A>": "\x1Ba",
"<Alt+B>": "\x1Bb",
"<Alt+C>": "\x1Bc",
"<Alt+D>": "\x1Bd",
"<Alt+E>": "\x1Be",
"<Alt+F>": "\x1Bf",
"<Alt+Enter>": "\x1B\r",
"<Alt+Tab>": "\x1B\t",
"<Shift+Tab>": "\x1B[Z",
"<Shift+Up>": "\x1B[1;2A",
"<Shift+Down>": "\x1B[1;2B",
"<Shift+Right>": "\x1B[1;2C",
"<Shift+Left>": "\x1B[1;2D",
}
KeyMap defines special key mappings
Functions ΒΆ
func TestEveryAssertionType ΒΆ added in v1.1.0
TestEveryAssertionType - Test tα»«ng loαΊ‘i assertion mα»t cΓ‘ch chi tiαΊΏt
Types ΒΆ
type ANSIBuilder ΒΆ
type ANSIBuilder struct {
// contains filtered or unexported fields
}
ANSIBuilder helps build ANSI sequences for testing
func (*ANSIBuilder) BgColor ΒΆ
func (a *ANSIBuilder) BgColor(color string) *ANSIBuilder
BgColor adds background color
func (*ANSIBuilder) Color ΒΆ
func (a *ANSIBuilder) Color(color string) *ANSIBuilder
Color adds foreground color
type ANSISequence ΒΆ
type ANSISequence struct {
Type string // color, cursor, clear, etc.
Code string
Params string
Position int
}
ANSISequence represents an ANSI escape sequence
type ActiveFailure ΒΆ added in v1.1.0
type ActiveFailure struct{}
type AdvancedAssertionEngine ΒΆ added in v1.1.0
type AdvancedAssertionEngine struct {
// contains filtered or unexported fields
}
AdvancedAssertionEngine provides comprehensive assertion capabilities for complex applications
func NewAdvancedAssertionEngine ΒΆ added in v1.1.0
func NewAdvancedAssertionEngine() *AdvancedAssertionEngine
NewAdvancedAssertionEngine creates an enhanced assertion engine
type AllocatedResources ΒΆ added in v1.1.0
type AllocatedResources struct{}
type Allocation ΒΆ added in v1.1.0
type Allocation struct {
Timestamp time.Time
Size uint64
Location string
Type string
Released bool
}
Allocation represents a memory allocation
type AllocationPattern ΒΆ added in v1.1.0
AllocationPattern represents allocation patterns
type AllocationTracker ΒΆ added in v1.1.0
type AllocationTracker struct {
// contains filtered or unexported fields
}
AllocationTracker tracks memory allocation patterns
type Anomaly ΒΆ added in v1.1.0
type Anomaly struct {
Type string
Severity string
Description string
Timestamp time.Time
Context map[string]interface{}
}
Anomaly represents detected unusual behavior
type ApplicationState ΒΆ added in v1.1.0
type ApplicationState struct {
ProcessTree ProcessInfo
MemoryLayout MemoryInfo
FileDescriptors []FDInfo
Configuration map[string]interface{}
InternalState map[string]interface{}
}
ApplicationState represents deep application state for validation
type Assertion ΒΆ
type Assertion struct {
Type AssertionType
Expected string
Message string
}
Assertion represents a test assertion
type AssertionFunc ΒΆ added in v1.1.0
type AssertionFunc func(actual, expected interface{}, context *TestContext) error
AssertionFunc represents a custom assertion function
type AssertionTestCases ΒΆ added in v1.1.0
type AssertionTestCases struct {
// contains filtered or unexported fields
}
AssertionTestCases - TαΊp hợp test cases chi tiαΊΏt cho tα»«ng assertion
func NewAssertionTestCases ΒΆ added in v1.1.0
func NewAssertionTestCases() *AssertionTestCases
type AssertionType ΒΆ
type AssertionType string
AssertionType represents types of assertions
const ( AssertContains AssertionType = "contains" AssertNotContains AssertionType = "not_contains" AssertNoCrash AssertionType = "no_crash" AssertNoHang AssertionType = "no_hang" AssertLayout AssertionType = "layout" AssertColor AssertionType = "color" AssertResponse AssertionType = "response" )
type BackoffStrategy ΒΆ added in v1.1.0
type BackoffStrategy int
type ColorInfo ΒΆ
ColorInfo contains color information for text
func ExtractColors ΒΆ
ExtractColors extracts visible colors from ANSI text
type ColorReport ΒΆ
type ColorReport struct {
HasColors bool
Has256Colors bool
HasTrueColor bool
HasStyles bool
TotalSequences int
ColorMap map[string]int
SequenceTypes map[string]int
}
ColorReport contains color usage information
type ColorTracker ΒΆ
type ColorTracker struct {
// contains filtered or unexported fields
}
ColorTracker tracks ANSI color usage
func NewColorTracker ΒΆ
func NewColorTracker() *ColorTracker
NewColorTracker creates a new color tracker
func (*ColorTracker) GetReport ΒΆ
func (c *ColorTracker) GetReport() ColorReport
GetReport returns color usage report
func (*ColorTracker) Process ΒΆ
func (c *ColorTracker) Process(data []byte)
Process processes data and extracts ANSI sequences
type ComprehensiveTestReport ΒΆ added in v1.1.0
type ComprehensiveTestReport struct {
Summary *ExecutionSummary
Suites map[string]*SuiteReport
Performance *PerformanceReport
Coverage *CoverageReport
Failures *FailureReport
Recommendations []Recommendation
}
type ConfigChange ΒΆ added in v1.1.0
type ConfigChange struct {
Timestamp time.Time
FilePath string
Key string
OldValue interface{}
NewValue interface{}
Source string
}
ConfigChange represents a configuration change
type ConfigSnapshot ΒΆ added in v1.1.0
type ConfigSnapshot struct {
Timestamp time.Time
FilePath string
Content map[string]interface{}
Checksum string
}
ConfigSnapshot represents configuration state at a point in time
type ConfigTracker ΒΆ added in v1.1.0
type ConfigTracker struct {
// contains filtered or unexported fields
}
ConfigTracker monitors configuration changes
func NewConfigTracker ΒΆ added in v1.1.0
func NewConfigTracker() *ConfigTracker
func (*ConfigTracker) Start ΒΆ added in v1.1.0
func (ct *ConfigTracker) Start() error
func (*ConfigTracker) Stop ΒΆ added in v1.1.0
func (ct *ConfigTracker) Stop() error
type ConfigValidationRule ΒΆ added in v1.1.0
type ConfigValidationRule struct {
Key string
Required bool
Type string
AllowedValues []interface{}
Validator func(interface{}) error
}
ConfigValidationRule defines configuration validation
type CoverageReport ΒΆ added in v1.1.0
type CoverageReport struct{}
type CrashScenario ΒΆ
type CrashScenario string
CrashScenario represents a crash test scenario
const ( // CrashRapidInput sends rapid keyboard input CrashRapidInput CrashScenario = "rapid_input" // CrashInvalidEscape sends malformed ANSI sequences CrashInvalidEscape CrashScenario = "invalid_escape" // CrashBufferOverflow attempts buffer overflow CrashBufferOverflow CrashScenario = "buffer_overflow" // CrashRapidResize rapidly resizes terminal CrashRapidResize CrashScenario = "rapid_resize" // CrashNullBytes sends null bytes CrashNullBytes CrashScenario = "null_bytes" // CrashUnicodeStress sends complex unicode CrashUnicodeStress CrashScenario = "unicode_stress" // CrashMemoryExhaust attempts to exhaust memory CrashMemoryExhaust CrashScenario = "memory_exhaust" )
type CrashType ΒΆ
type CrashType int
CrashType represents types of crashes
func GetCrashType ΒΆ
GetCrashType determines crash type from exit code
type CriticalFailure ΒΆ added in v1.1.0
type CriticalFailure struct{}
type DataProvider ΒΆ added in v1.1.0
type DataProvider struct{}
type DebugCollector ΒΆ added in v1.1.0
type DebugCollector struct{}
type DependencyEdge ΒΆ added in v1.1.0
type DependencyEdge struct {
From string
To string
Type DependencyType
Required bool
Condition func() bool
}
DependencyEdge represents a dependency relationship
type DependencyGraph ΒΆ added in v1.1.0
type DependencyGraph struct {
// contains filtered or unexported fields
}
DependencyGraph manages test suite dependencies
func NewDependencyGraph ΒΆ added in v1.1.0
func NewDependencyGraph() *DependencyGraph
Constructor stubs
func (*DependencyGraph) AddNode ΒΆ added in v1.1.0
func (dg *DependencyGraph) AddNode(suite TestSuite) error
Method stubs for dependency graph
func (*DependencyGraph) Resolve ΒΆ added in v1.1.0
func (dg *DependencyGraph) Resolve() error
type DependencyNode ΒΆ added in v1.1.0
type DependencyNode struct {
ID string
Suite *TestSuite
Status NodeStatus
Priority int
}
DependencyNode represents a test suite in the dependency graph
type DependencyType ΒΆ added in v1.1.0
type DependencyType int
type EnhancedTestCase ΒΆ added in v1.1.0
type EnhancedTestCase struct {
// Basic info
TestCase
// Advanced features
Prerequisites []Prerequisite
SetupFunc func(*EnhancedTestContext) error
ExecuteFunc func(*EnhancedTestContext) error
ValidateFunc func(*EnhancedTestContext) error
CleanupFunc func(*EnhancedTestContext) error
// Test data and parameterization
TestData []TestDataSet
DataProviders []DataProvider
// Expectations
ExpectedResults []ExpectedResult
PerformanceLimits PerformanceLimits
// Error handling
ExpectedErrors []ExpectedError
RecoverySteps []RecoveryStep
// Integration points
StateChecks []StateCheck
SideEffectChecks []SideEffectCheck
}
EnhancedTestCase extends basic test case with advanced features
type EnhancedTestContext ΒΆ added in v1.1.0
type EnhancedTestContext struct {
// Basic context
TestContext
// Enhanced features
StateInspector *StateInspector
DataProviders map[string]DataProvider
TestData map[string]interface{}
// Execution state
ExecutionPhase ExecutionPhase
RetryAttempt int
LastError error
// Monitoring and debugging
PerformanceCollector *PerformanceCollector
DebugCollector *DebugCollector
TraceCollector *TraceCollector
}
EnhancedTestContext provides rich context for test execution
type EscalationRule ΒΆ added in v1.1.0
type EscalationRule struct{}
type EscapeKey ΒΆ
type EscapeKey string
EscapeKey represents a keyboard key that can be sent
const ( // Control keys CtrlA EscapeKey = "\x01" CtrlB EscapeKey = "\x02" CtrlC EscapeKey = "\x03" CtrlD EscapeKey = "\x04" CtrlE EscapeKey = "\x05" CtrlF EscapeKey = "\x06" CtrlG EscapeKey = "\x07" CtrlH EscapeKey = "\x08" CtrlI EscapeKey = "\x09" CtrlJ EscapeKey = "\x0A" CtrlK EscapeKey = "\x0B" CtrlL EscapeKey = "\x0C" CtrlM EscapeKey = "\x0D" CtrlN EscapeKey = "\x0E" CtrlO EscapeKey = "\x0F" CtrlP EscapeKey = "\x10" CtrlQ EscapeKey = "\x11" CtrlR EscapeKey = "\x12" CtrlS EscapeKey = "\x13" CtrlT EscapeKey = "\x14" CtrlU EscapeKey = "\x15" CtrlV EscapeKey = "\x16" CtrlW EscapeKey = "\x17" CtrlX EscapeKey = "\x18" CtrlY EscapeKey = "\x19" CtrlZ EscapeKey = "\x1A" // Special keys Enter EscapeKey = "\r" Tab EscapeKey = "\t" Backspace EscapeKey = "\x7F" Delete EscapeKey = "\x1B[3~" Escape EscapeKey = "\x1B" Space EscapeKey = " " // Arrow keys ArrowUp EscapeKey = "\x1B[A" ArrowDown EscapeKey = "\x1B[B" ArrowRight EscapeKey = "\x1B[C" ArrowLeft EscapeKey = "\x1B[D" // Navigation Home EscapeKey = "\x1B[H" End EscapeKey = "\x1B[F" PageUp EscapeKey = "\x1B[5~" PageDown EscapeKey = "\x1B[6~" )
type ExecutionCoordinator ΒΆ added in v1.1.0
type ExecutionCoordinator struct{}
type ExecutionJob ΒΆ added in v1.1.0
type ExecutionJob struct{}
type ExecutionPhase ΒΆ added in v1.1.0
type ExecutionPhase struct {
ID string
Name string
Description string
TestSuites []string
ParallelGroups []ParallelGroup
Dependencies []string
EstimatedTime time.Duration
CriticalPath bool
}
ExecutionPhase represents a phase of test execution
type ExecutionPlan ΒΆ added in v1.1.0
type ExecutionPlan struct {
Phases []ExecutionPhase
TotalEstimation time.Duration
ResourcePlan *ResourceAllocationPlan
RiskAssessment *RiskAssessment
}
ExecutionPlan defines the order and method of test execution
type ExecutionResult ΒΆ added in v1.1.0
type ExecutionResult struct{}
type ExecutionResults ΒΆ added in v1.1.0
type ExecutionResults struct {
StartTime time.Time
EndTime time.Time
Duration time.Duration
Phases map[string]*PhaseResults
}
Result types
type ExecutionSummary ΒΆ added in v1.1.0
type ExecutionSummary struct{}
type ExpectedError ΒΆ added in v1.1.0
type ExpectedError struct{}
type ExpectedResult ΒΆ added in v1.1.0
type ExpectedResult struct{}
type FailureEvent ΒΆ added in v1.1.0
type FailureEvent struct{}
type FailureHandler ΒΆ added in v1.1.0
type FailureHandler struct {
// contains filtered or unexported fields
}
FailureHandler manages test failure scenarios
func NewFailureHandler ΒΆ added in v1.1.0
func NewFailureHandler() *FailureHandler
type FailureInfo ΒΆ added in v1.1.0
type FailureInfo struct{}
type FailureReport ΒΆ added in v1.1.0
type FailureReport struct{}
type FailureType ΒΆ added in v1.1.0
type FailureType int
type FileOperation ΒΆ added in v1.1.0
type FileOperation struct {
Timestamp time.Time
Operation string // "open", "close", "read", "write", "delete"
Path string
Size int64
Success bool
Error string
}
FileOperation represents a file system operation
type FileSystemLimits ΒΆ added in v1.1.0
type FileSystemLimits struct {
MaxOpenFiles int
MaxFileSize int64
MaxTotalWrites int64
MaxTotalReads int64
}
FileSystemLimits defines file system usage limits
type FileSystemWatcher ΒΆ added in v1.1.0
type FileSystemWatcher struct {
// contains filtered or unexported fields
}
FileSystemWatcher monitors file system operations
func NewFileSystemWatcher ΒΆ added in v1.1.0
func NewFileSystemWatcher() *FileSystemWatcher
func (*FileSystemWatcher) Start ΒΆ added in v1.1.0
func (fsw *FileSystemWatcher) Start() error
func (*FileSystemWatcher) Stop ΒΆ added in v1.1.0
func (fsw *FileSystemWatcher) Stop() error
type Frame ΒΆ
type Frame struct {
Timestamp time.Time
Content string
ASCII string
Width int
Height int
CursorX int
CursorY int
}
Frame represents a single frame of terminal output
type GlobalTestState ΒΆ added in v1.1.0
type GlobalTestState struct {
TotalTests int
CompletedTests int
PassedTests int
FailedTests int
SkippedTests int
StartTime time.Time
EstimatedEndTime time.Time
GlobalVariables map[string]interface{}
CriticalFailures []CriticalFailure
}
GlobalTestState represents the overall test execution state
type HealthReport ΒΆ
type HealthReport struct {
Uptime time.Duration
Crashed bool
CrashReason string
ExitCode int
IsHanging bool
HangDuration time.Duration
LastActivity time.Time
AvgResponseTime time.Duration
}
HealthReport contains health status
type HealthTracker ΒΆ
type HealthTracker struct {
// contains filtered or unexported fields
}
HealthTracker monitors application health
func NewHealthTracker ΒΆ
func NewHealthTracker() *HealthTracker
NewHealthTracker creates a new health tracker
func (*HealthTracker) CheckHang ΒΆ
func (h *HealthTracker) CheckHang() bool
CheckHang checks if application is hanging
func (*HealthTracker) GetReport ΒΆ
func (h *HealthTracker) GetReport() HealthReport
GetReport returns health report
func (*HealthTracker) RecordCrash ΒΆ
func (h *HealthTracker) RecordCrash(reason string, code int)
RecordCrash records a crash
func (*HealthTracker) RecordResponseTime ΒΆ
func (h *HealthTracker) RecordResponseTime(duration time.Duration)
RecordResponseTime records command response time
func (*HealthTracker) UpdateActivity ΒΆ
func (h *HealthTracker) UpdateActivity()
UpdateActivity updates last activity time
type LayoutType ΒΆ
type LayoutType int
LayoutType represents types of layout verification
const ( // Centered checks if content is centered Centered LayoutType = iota // HasBorder checks for border characters HasBorder // Responsive checks if layout adapts to size Responsive // HorizontalSplit checks for horizontal split HorizontalSplit // VerticalSplit checks for vertical split VerticalSplit )
type LeakDetector ΒΆ added in v1.1.0
type LeakDetector struct {
// contains filtered or unexported fields
}
LeakDetector identifies memory leaks
type LeakThresholds ΒΆ added in v1.1.0
type LeakThresholds struct {
MaxGrowthRate float64 // MB per second
MaxGrowthDuration time.Duration
MinLeakSize uint64 // bytes
ConsecutiveIncreases int
}
LeakThresholds defines leak detection thresholds
type MemoryAnalyzer ΒΆ added in v1.1.0
type MemoryAnalyzer struct {
// contains filtered or unexported fields
}
MemoryAnalyzer provides deep memory analysis
func NewMemoryAnalyzer ΒΆ added in v1.1.0
func NewMemoryAnalyzer() *MemoryAnalyzer
func (*MemoryAnalyzer) DetectedLeaks ΒΆ added in v1.1.0
func (ma *MemoryAnalyzer) DetectedLeaks() int
func (*MemoryAnalyzer) GetLatestSnapshot ΒΆ added in v1.1.0
func (ma *MemoryAnalyzer) GetLatestSnapshot() MemorySnapshot
func (*MemoryAnalyzer) LeakBytes ΒΆ added in v1.1.0
func (ma *MemoryAnalyzer) LeakBytes() uint64
func (*MemoryAnalyzer) Start ΒΆ added in v1.1.0
func (ma *MemoryAnalyzer) Start() error
func (*MemoryAnalyzer) Stop ΒΆ added in v1.1.0
func (ma *MemoryAnalyzer) Stop() error
type MemoryInfo ΒΆ added in v1.1.0
type MemoryInfo struct {
HeapSize uint64
StackSize uint64
Allocations uint64
Deallocations uint64
LeakCount int
LeakBytes uint64
}
MemoryInfo contains memory layout information
type MemoryLeak ΒΆ
MemoryLeak represents a potential memory leak
type MemorySnapshot ΒΆ added in v1.1.0
type MemorySnapshot struct {
Timestamp time.Time
HeapSize uint64
HeapUsed uint64
StackSize uint64
Allocations uint64
Deallocations uint64
GCCycles uint64
LiveObjects map[string]int
}
MemorySnapshot captures memory state at a point in time
type Monitor ΒΆ
type Monitor struct {
// contains filtered or unexported fields
}
Monitor tracks process metrics
func (*Monitor) CheckMemoryLeak ΒΆ
func (m *Monitor) CheckMemoryLeak() []MemoryLeak
CheckMemoryLeak checks for potential memory leaks
func (*Monitor) GetMetrics ΒΆ
GetMetrics returns current metrics
type NetworkConnection ΒΆ added in v1.1.0
type NetworkConnection struct {
LocalAddr string
RemoteAddr string
State string
Protocol string
BytesSent uint64
BytesRecv uint64
}
NetworkConnection represents a network connection
type NetworkLimits ΒΆ added in v1.1.0
type NetworkLimits struct {
MaxConnections int
MaxBytesPerSec uint64
MaxTotalTraffic uint64
AllowedProtocols []string
}
NetworkLimits defines network usage limits
type NetworkMonitor ΒΆ added in v1.1.0
type NetworkMonitor struct {
// contains filtered or unexported fields
}
NetworkMonitor tracks network operations
func NewNetworkMonitor ΒΆ added in v1.1.0
func NewNetworkMonitor() *NetworkMonitor
func (*NetworkMonitor) Start ΒΆ added in v1.1.0
func (nm *NetworkMonitor) Start() error
func (*NetworkMonitor) Stop ΒΆ added in v1.1.0
func (nm *NetworkMonitor) Stop() error
type NetworkTraffic ΒΆ added in v1.1.0
type NetworkTraffic struct {
Timestamp time.Time
BytesSent uint64
BytesRecv uint64
Connections int
}
NetworkTraffic represents network traffic metrics
type NodeStatus ΒΆ added in v1.1.0
type NodeStatus int
type ParallelExecutor ΒΆ added in v1.1.0
type ParallelExecutor struct {
// contains filtered or unexported fields
}
ParallelExecutor manages parallel test execution
func NewParallelExecutor ΒΆ added in v1.1.0
func NewParallelExecutor() *ParallelExecutor
type ParallelGroup ΒΆ added in v1.1.0
ParallelGroup defines tests that can run in parallel
type PerformanceCollector ΒΆ added in v1.1.0
type PerformanceCollector struct{}
type PerformanceLimits ΒΆ added in v1.1.0
type PerformanceLimits struct{}
type PerformanceMetrics ΒΆ
type PerformanceMetrics struct {
AvgResponseTime time.Duration
MaxResponseTime time.Duration
MinResponseTime time.Duration
AvgCPU float64
MaxCPU float64
AvgMemory uint64
MaxMemory uint64
ThroughputOps int
}
PerformanceMetrics contains performance measurements
type PerformanceReport ΒΆ added in v1.1.0
type PerformanceReport struct{}
type PhaseResults ΒΆ added in v1.1.0
type Prerequisite ΒΆ added in v1.1.0
type Prerequisite struct{}
type ProcessInfo ΒΆ added in v1.1.0
type ProcessInfo struct {
PID int
Children []ProcessInfo
MemoryUsage uint64
CPUUsage float64
OpenFiles int
ThreadCount int
Status string
}
ProcessInfo contains process tree information
type ProcessMetric ΒΆ added in v1.1.0
type ProcessMetric struct {
Timestamp time.Time
PID int
CPU float64
Memory uint64
FileHandles int
Threads int
Status string
}
ProcessMetric represents a point-in-time process metric
type ProcessMonitor ΒΆ added in v1.1.0
type ProcessMonitor struct {
// contains filtered or unexported fields
}
ProcessMonitor tracks process tree and resource usage
func NewProcessMonitor ΒΆ added in v1.1.0
func NewProcessMonitor(pid int) *ProcessMonitor
Implementation stubs for component constructors
func (*ProcessMonitor) GetLatestMetrics ΒΆ added in v1.1.0
func (pm *ProcessMonitor) GetLatestMetrics() ProcessMetric
func (*ProcessMonitor) Start ΒΆ added in v1.1.0
func (pm *ProcessMonitor) Start() error
Method stubs for component operations
func (*ProcessMonitor) Stop ΒΆ added in v1.1.0
func (pm *ProcessMonitor) Stop() error
type ProgressTracker ΒΆ added in v1.1.0
type ProgressTracker struct{}
func NewProgressTracker ΒΆ added in v1.1.0
func NewProgressTracker() *ProgressTracker
func (*ProgressTracker) UpdatePhaseProgress ΒΆ added in v1.1.0
func (pt *ProgressTracker) UpdatePhaseProgress(phaseID string, percent int)
Method stubs for progress tracker
type Recommendation ΒΆ added in v1.1.0
type Recommendation struct{}
type RecoveryStep ΒΆ added in v1.1.0
type RecoveryStep struct{}
type RecoveryStrategy ΒΆ added in v1.1.0
type RecoveryStrategy struct {
Name string
Description string
TriggerConditions []TriggerCondition
RecoverySteps []RecoveryStep
MaxRecoveryTime time.Duration
SuccessCriteria []SuccessCriterion
}
RecoveryStrategy defines how to recover from failures
type ReportGenerator ΒΆ added in v1.1.0
type ReportGenerator struct{}
func NewReportGenerator ΒΆ added in v1.1.0
func NewReportGenerator() *ReportGenerator
func (*ReportGenerator) GenerateReport ΒΆ added in v1.1.0
func (rg *ReportGenerator) GenerateReport(results *ExecutionResults, state *GlobalTestState) (*ComprehensiveTestReport, error)
Method stubs for report generator
type ResourceAllocation ΒΆ added in v1.1.0
type ResourceAllocation struct {
MemoryMB int
CPUPercent float64
NetworkMBps int
DiskSpaceMB int
Priority int
}
ResourceAllocation defines resource allocation for a test suite
type ResourceAllocationPlan ΒΆ added in v1.1.0
type ResourceAllocationPlan struct {
TotalMemoryMB int
TotalCPUCores int
NetworkBandwidth int
DiskSpaceGB int
PerSuiteAllocation map[string]ResourceAllocation
}
ResourceAllocationPlan manages test resource allocation
type ResourceLimits ΒΆ added in v1.1.0
type ResourceLimits struct {
MaxMemoryMB uint64
MaxCPUPercent float64
MaxFileHandles int
MaxThreads int
}
ResourceLimits defines resource usage limits
type ResourceManager ΒΆ added in v1.1.0
type ResourceManager struct{}
type ResourceRequirements ΒΆ added in v1.1.0
type ResourceRequirements struct{}
type ResourceUsage ΒΆ added in v1.1.0
type ResourceUsage struct{}
type RetryCondition ΒΆ added in v1.1.0
type RetryCondition struct{}
type RetryPolicy ΒΆ added in v1.1.0
type RetryPolicy struct {
MaxAttempts int
RetryInterval time.Duration
BackoffStrategy BackoffStrategy
RetryConditions []RetryCondition
MaxTotalTime time.Duration
RetryOnFailures []FailureType
}
RetryPolicy defines how to handle test retries
func DefaultRetryPolicy ΒΆ added in v1.1.0
func DefaultRetryPolicy() *RetryPolicy
type RiskAssessment ΒΆ added in v1.1.0
type RiskAssessment struct{}
type RollbackOperation ΒΆ added in v1.1.0
type RollbackOperation struct{}
type SharedResourcePool ΒΆ added in v1.1.0
type SharedResourcePool struct{}
type SideEffectCheck ΒΆ added in v1.1.0
type SideEffectCheck struct{}
type StateCheck ΒΆ added in v1.1.0
type StateCheck struct{}
type StateCheckpoint ΒΆ added in v1.1.0
type StateCheckpoint struct{}
type StateInspector ΒΆ added in v1.1.0
type StateInspector struct {
// contains filtered or unexported fields
}
StateInspector provides deep application state inspection capabilities
func NewStateInspector ΒΆ added in v1.1.0
func NewStateInspector(pid int) *StateInspector
NewStateInspector creates a comprehensive state inspector
func (*StateInspector) DetectAnomalies ΒΆ added in v1.1.0
func (si *StateInspector) DetectAnomalies() []Anomaly
DetectAnomalies identifies unusual behavior patterns
func (*StateInspector) GetApplicationState ΒΆ added in v1.1.0
func (si *StateInspector) GetApplicationState() ApplicationState
GetApplicationState returns comprehensive application state
func (*StateInspector) StartInspection ΒΆ added in v1.1.0
func (si *StateInspector) StartInspection() error
StartInspection begins comprehensive state monitoring
func (*StateInspector) StopInspection ΒΆ added in v1.1.0
func (si *StateInspector) StopInspection() error
StopInspection stops all monitoring
func (*StateInspector) ValidateState ΒΆ added in v1.1.0
func (si *StateInspector) ValidateState(validators map[string]StateValidator) error
ValidateState performs comprehensive state validation
type StateValidator ΒΆ added in v1.1.0
type StateValidator func(appState ApplicationState) error
StateValidator validates complex application state
type Step ΒΆ
type Step struct {
Action StepAction
Input string
Duration time.Duration
Size *Size
Screenshot bool
Description string
}
Step represents a test step
type StepAction ΒΆ
type StepAction string
StepAction represents types of test actions
const ( ActionKeys StepAction = "keys" ActionWait StepAction = "wait" ActionResize StepAction = "resize" ActionScreenshot StepAction = "screenshot" ActionVerify StepAction = "verify" )
type StressTestConfig ΒΆ
type StressTestConfig struct {
Duration time.Duration
InputRate int // inputs per second
ResizeRate int // resizes per second
PaneCount int
MaxMemoryMB int
MaxCPUPercent float64
EnableCrash bool
EnableLeak bool
EnableHang bool
}
StressTestConfig configures stress testing
type SuccessCriterion ΒΆ added in v1.1.0
type SuccessCriterion struct{}
type SuitePerformance ΒΆ added in v1.1.0
type SuitePerformance struct{}
type SuiteReport ΒΆ added in v1.1.0
type SuiteReport struct{}
type SuiteResults ΒΆ added in v1.1.0
type SuiteState ΒΆ added in v1.1.0
type SuiteState struct {
SuiteID string
Status SuiteStatus
StartTime time.Time
EndTime time.Time
CompletedTests []string
FailedTests []FailureInfo
Performance *SuitePerformance
ResourceUsage *ResourceUsage
}
SuiteState represents the state of a test suite
type SuiteStatus ΒΆ added in v1.1.0
type SuiteStatus int
type TeardownStep ΒΆ added in v1.1.0
type TeardownStep struct{}
type Terminal ΒΆ
type Terminal struct {
// contains filtered or unexported fields
}
Terminal represents a virtual terminal for testing
func NewTerminal ΒΆ
NewTerminal creates a new virtual terminal for testing
func (*Terminal) ConfigureWatchdog ΒΆ added in v1.0.2
func (t *Terminal) ConfigureWatchdog(config WatchdogConfig)
ConfigureWatchdog updates watchdog configuration
func (*Terminal) GetWatchdogStats ΒΆ added in v1.0.2
func (t *Terminal) GetWatchdogStats() WatchdogStats
GetWatchdogStats returns watchdog statistics
func (*Terminal) Health ΒΆ
func (t *Terminal) Health() HealthReport
Health returns current health status
func (*Terminal) NotContains ΒΆ
NotContains checks if screen does not contain text
func (*Terminal) Screenshot ΒΆ
Screenshot returns an ASCII art screenshot of current state
func (*Terminal) SetLogFile ΒΆ
SetLogFile sets the log file for debugging
func (*Terminal) SetTimeouts ΒΆ added in v1.0.2
SetTimeouts configures terminal timeouts
func (*Terminal) StartRecording ΒΆ
func (t *Terminal) StartRecording()
StartRecording starts recording frames
func (*Terminal) StopRecording ΒΆ
StopRecording stops recording and returns frames
func (*Terminal) VerifyColors ΒΆ
func (t *Terminal) VerifyColors() ColorReport
VerifyColors returns color verification report
func (*Terminal) VerifyLayout ΒΆ
func (t *Terminal) VerifyLayout(layout LayoutType) bool
VerifyLayout checks layout properties
type TestCase ΒΆ
type TestCase struct {
Name string
Description string
Size Size
Steps []Step
Assertions []Assertion
Timeout time.Duration
}
TestCase represents a complete test scenario
type TestContext ΒΆ added in v1.1.1
type TestContext struct {
TestName string
CurrentStep int
TotalSteps int
StartTime time.Time
TerminalSize Size
Screenshot string
PreviousOutput string
Metadata map[string]interface{}
}
TestContext provides context information during test execution
type TestDataSet ΒΆ added in v1.1.0
type TestDataSet struct{}
type TestOrchestrator ΒΆ added in v1.1.0
type TestOrchestrator struct {
// contains filtered or unexported fields
}
TestOrchestrator manages complex test execution flows
func NewTestOrchestrator ΒΆ added in v1.1.0
func NewTestOrchestrator() *TestOrchestrator
NewTestOrchestrator creates a comprehensive test orchestrator
func (*TestOrchestrator) AddTestSuite ΒΆ added in v1.1.0
func (to *TestOrchestrator) AddTestSuite(suite TestSuite) error
AddTestSuite adds a test suite to the orchestrator
func (*TestOrchestrator) ExecuteAllTests ΒΆ added in v1.1.0
func (to *TestOrchestrator) ExecuteAllTests(ctx context.Context) (*ComprehensiveTestReport, error)
ExecuteAllTests executes all test suites according to dependencies and plan
type TestPerformanceMonitor ΒΆ added in v1.1.0
type TestPerformanceMonitor struct{}
func NewTestPerformanceMonitor ΒΆ added in v1.1.0
func NewTestPerformanceMonitor() *TestPerformanceMonitor
type TestResult ΒΆ
type TestResult struct {
TestCase TestCase
Passed bool
Duration time.Duration
Errors []string
Screenshots []string
Metrics map[string]interface{}
Health HealthReport
Colors ColorReport
}
TestResult contains test execution results
type TestResults ΒΆ added in v1.1.0
type TestStateManager ΒΆ added in v1.1.0
type TestStateManager struct {
// contains filtered or unexported fields
}
TestStateManager manages test execution state
func NewTestStateManager ΒΆ added in v1.1.0
func NewTestStateManager() *TestStateManager
type TestSuite ΒΆ added in v1.1.0
type TestSuite struct {
ID string
Name string
Description string
Priority int
Tags []string
// Dependencies
Prerequisites []string
SoftDependencies []string
ConflictsWith []string
// Setup and teardown
SetupSteps []SetupStep
TeardownSteps []TeardownStep
// Test cases
TestCases []EnhancedTestCase
// Execution configuration
ParallelSafe bool
IsolationLevel IsolationLevel
RetryPolicy *RetryPolicy
Timeout time.Duration
// Resource requirements
ResourceRequirements ResourceRequirements
}
TestSuite represents a comprehensive test suite with complex dependencies
type TestWorker ΒΆ added in v1.1.0
type TestWorker struct {
ID string
Status WorkerStatus
CurrentTest *EnhancedTestCase
Resources *AllocatedResources
Performance *WorkerPerformance
}
TestWorker executes individual tests
type TraceCollector ΒΆ added in v1.1.0
type TraceCollector struct{}
type TriggerCondition ΒΆ added in v1.1.0
type TriggerCondition struct{}
type VisualComparator ΒΆ added in v1.1.0
type VisualComparator struct {
// contains filtered or unexported fields
}
VisualComparator provides advanced visual comparison
func NewVisualComparator ΒΆ added in v1.1.0
func NewVisualComparator() *VisualComparator
NewVisualComparator creates a visual comparison engine
type Watchdog ΒΆ added in v1.0.2
type Watchdog struct {
// contains filtered or unexported fields
}
Watchdog provides comprehensive hang detection and prevention
func NewWatchdog ΒΆ added in v1.0.2
NewWatchdog creates a new watchdog for terminal monitoring
func (*Watchdog) Configure ΒΆ added in v1.0.2
func (w *Watchdog) Configure(config WatchdogConfig)
Configure updates watchdog configuration
func (*Watchdog) EndOperation ΒΆ added in v1.0.2
func (w *Watchdog) EndOperation()
EndOperation notifies watchdog that an operation completed
func (*Watchdog) GetStats ΒΆ added in v1.0.2
func (w *Watchdog) GetStats() WatchdogStats
GetStats returns watchdog statistics
func (*Watchdog) Start ΒΆ added in v1.0.2
func (w *Watchdog) Start()
Start begins watchdog monitoring
func (*Watchdog) StartOperation ΒΆ added in v1.0.2
StartOperation notifies watchdog that an operation is starting
func (*Watchdog) UpdateActivity ΒΆ added in v1.0.2
func (w *Watchdog) UpdateActivity()
UpdateActivity updates the last activity timestamp
type WatchdogConfig ΒΆ added in v1.0.2
type WatchdogConfig struct {
MaxResponse time.Duration
CheckInterval time.Duration
ForceKillTimeout time.Duration
}
WatchdogConfig contains watchdog configuration
type WatchdogStats ΒΆ added in v1.0.2
type WatchdogStats struct {
TimeoutCount int
ForceKillCount int
HangCount int
EmergencyMode bool
CurrentOp string
LastActivity time.Time
IsHanging bool
}
WatchdogStats contains watchdog statistics
type WorkerPerformance ΒΆ added in v1.1.0
type WorkerPerformance struct{}
type WorkerPool ΒΆ added in v1.1.0
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool manages test execution workers
type WorkerStatus ΒΆ added in v1.1.0
type WorkerStatus int