Documentation
¶
Index ¶
- Constants
- Variables
- func AcquireConcurrencySlot(testName string) func()
- func AssertE2NodeSetHasOwnerReference(ctx context.Context, k8sClient client.Client, e2ns *nephoranv1.E2NodeSet, ...)
- func AssertNetworkIntentHasCondition(ni *nephoranv1.NetworkIntent, conditionType string, ...)
- func BatchCreateFiles(baseDir string, files map[string][]byte) error
- func CleanupGlobalOptimizers()
- func CleanupIsolatedNamespace(namespaceName string)
- func CleanupTestResources(ctx context.Context, k8sClient client.Client, namespace string)
- func CreateConfigMap(ctx context.Context, k8sClient client.Client, name, namespace string, ...) *corev1.ConfigMap
- func CreateDeployedNetworkIntent(fixture NetworkIntentFixture) *nephoranv1.NetworkIntent
- func CreateE2NodeSet(fixture E2NodeSetFixture) *nephoranv1.E2NodeSet
- func CreateE2NodeSetWithAnnotations(name, namespace string, replicas int32, annotations map[string]string) *nephoranv1.E2NodeSet
- func CreateE2NodeSetWithCustomEndpoint(name, namespace string, replicas int32, ricEndpoint string) *nephoranv1.E2NodeSet
- func CreateE2NodeSetWithFinalizer(ctx context.Context, k8sClient client.Client, name, namespace string, ...) *nephoranv1.E2NodeSet
- func CreateIsolatedNamespace(prefix string) string
- func CreateMinimalE2NodeSet(name, namespace string, replicas int32) *nephoranv1.E2NodeSet
- func CreateNamespace(ctx context.Context, k8sClient client.Client, name string) *corev1.Namespace
- func CreateNetworkIntent(fixture NetworkIntentFixture) *nephoranv1.NetworkIntent
- func CreateOptimizedTempDir(t testing.TB, prefix string) string
- func CreateProcessedNetworkIntent(fixture NetworkIntentFixture) *nephoranv1.NetworkIntent
- func CreateReadyE2NodeSet(fixture E2NodeSetFixture) *nephoranv1.E2NodeSet
- func CreateTestContext() (context.Context, context.CancelFunc)
- func CreateTestNamespace() *corev1.Namespace
- func CreateTestNetworkIntent(name, namespace, intent string) *nephoranv1.NetworkIntent
- func CreateTestSecret(ctx context.Context, k8sClient client.Client, name, namespace string, ...) *corev1.Secret
- func DeleteConfigMap(ctx context.Context, k8sClient client.Client, name, namespace string)
- func DeleteNamespace(ctx context.Context, k8sClient client.Client, name string)
- func ExampleOptimizedCleanup(t *testing.T)
- func ExampleOptimizedFileCreation(t *testing.T)
- func ExampleOptimizedIntegrationTest(t *testing.T)
- func ExampleOptimizedParallelism(t *testing.T)
- func ExampleOptimizedTestData(t *testing.T)
- func ExampleOptimizedTimeout(t *testing.T)
- func ExampleStandardCleanup(t *testing.T)
- func ExampleStandardFileCreation(t *testing.T)
- func ExampleStandardIntegrationTest(t *testing.T)
- func ExampleStandardParallelism(t *testing.T)
- func ExampleStandardTestData(t *testing.T)
- func ExampleStandardTimeout(t *testing.T)
- func GenerateUniqueName(prefix string) string
- func GenerateUniqueNamespace(prefix string) string
- func GetE2NodeSet(ctx context.Context, k8sClient client.Client, ...) *nephoranv1.E2NodeSet
- func GetE2NodeSetByLabels(ctx context.Context, k8sClient client.Client, namespace string, ...) ([]nephoranv1.E2NodeSet, error)
- func GetE2NodeSetConfigMaps(ctx context.Context, k8sClient client.Client, e2nodeSet *nephoranv1.E2NodeSet) (*corev1.ConfigMapList, error)
- func GetE2NodeSetReadyReplicasCount(ctx context.Context, k8sClient client.Client, ...) int32
- func GetNetworkIntent(ctx context.Context, k8sClient client.Client, ...) *nephoranv1.NetworkIntent
- func GetOptimizedContext(ctx context.Context, baseTimeout time.Duration) (context.Context, context.CancelFunc)
- func GetOptimizedTempDir(t testing.TB, prefix string) string
- func GetOptimizedTimeout(baseTimeout time.Duration) time.Duration
- func GetResourceCounts(ctx context.Context, k8sClient client.Client, namespace string) (map[string]int, error)
- func GetUniqueName(prefix string) string
- func IsConditionTrue(conditions []metav1.Condition, conditionType string) bool
- func NormalizePath(path string) string
- func ReadFileOptimized(filePath string) ([]byte, error)
- func UpdateE2NodeSetReplicas(ctx context.Context, k8sClient client.Client, ...)
- func UpdateE2NodeSetStatus(ctx context.Context, k8sClient client.Client, e2ns *nephoranv1.E2NodeSet)
- func UpdateNetworkIntentStatus(ctx context.Context, k8sClient client.Client, ni *nephoranv1.NetworkIntent)
- func VerifyE2NodeSetAnnotation(ctx context.Context, k8sClient client.Client, ...)
- func VerifyE2NodeSetFinalizer(ctx context.Context, k8sClient client.Client, ...)
- func VerifyNoConfigMapOperations(ctx context.Context, k8sClient client.Client, namespace string, ...)
- func VerifyOwnerReferences(ctx context.Context, k8sClient client.Client, owner client.Object, ...) error
- func VerifyResourceConsistency(ctx context.Context, k8sClient client.Client, namespace string) error
- func WaitForConditionWithReason(ctx context.Context, k8sClient client.Client, ...)
- func WaitForConfigMapCount(ctx context.Context, k8sClient client.Client, namespace string, ...)
- func WaitForE2NodeSetDeletion(ctx context.Context, k8sClient client.Client, ...)
- func WaitForE2NodeSetFinalizer(ctx context.Context, k8sClient client.Client, ...)
- func WaitForE2NodeSetReady(ctx context.Context, k8sClient client.Client, ...)
- func WaitForE2NodeSetScaling(ctx context.Context, k8sClient client.Client, ...)
- func WaitForE2NodeSetStatusUpdate(ctx context.Context, k8sClient client.Client, ...)
- func WaitForMultipleE2NodeSetsReady(ctx context.Context, k8sClient client.Client, ...)
- func WaitForMultipleNetworkIntentsProcessed(ctx context.Context, k8sClient client.Client, ...)
- func WaitForNetworkIntentMessage(ctx context.Context, k8sClient client.Client, ...)
- func WaitForNetworkIntentPhase(ctx context.Context, k8sClient client.Client, ...)
- func WaitForOwnerReferences(ctx context.Context, k8sClient client.Client, owner client.Object, ...)
- func WaitForResourceConsistency(ctx context.Context, k8sClient client.Client, namespace string)
- func WaitForResourceDeletion(ctx context.Context, k8sClient client.Client, obj client.Object)
- func WithOptimizedTest(t *testing.T, testFunc func(*testing.T, *TestContext))
- func WithOptimizedTimeout(ctx context.Context, baseTimeout time.Duration) (context.Context, context.CancelFunc)
- func WriteFileOptimized(filePath string, content []byte) error
- type BatchFileProcessor
- type E2NodeSetFixture
- type EnhancedMockGitClient
- type MockDependencies
- func (m *MockDependencies) GetEventRecorder() record.EventRecorder
- func (m *MockDependencies) GetGitClient() git.ClientInterface
- func (m *MockDependencies) GetHTTPClient() *http.Client
- func (m *MockDependencies) GetLLMClient() shared.ClientInterface
- func (m *MockDependencies) GetMetricsCollector() monitoring.MetricsCollector
- func (m *MockDependencies) GetPackageGenerator() *nephio.PackageGenerator
- func (m *MockDependencies) GetTelecomKnowledgeBase() *telecom.TelecomKnowledgeBase
- type MockDependenciesBuilder
- type MockDependenciesComprehensive
- type MockGitClient
- func (m *MockGitClient) Add(path string) error
- func (m *MockGitClient) AddRemote(name, url string) error
- func (m *MockGitClient) ApplyPatch(patch string) error
- func (m *MockGitClient) ApprovePullRequest(id int) error
- func (m *MockGitClient) CherryPick(commitHash string) error
- func (m *MockGitClient) Clean(force bool) error
- func (m *MockGitClient) CommitAndPush(files map[string]string, message string) (string, error)
- func (m *MockGitClient) CommitAndPushChanges(message string) error
- func (m *MockGitClient) CommitFiles(files []string, msg string) error
- func (m *MockGitClient) CreateBranch(name string) error
- func (m *MockGitClient) CreatePatch(options git.DiffOptions) (string, error)
- func (m *MockGitClient) CreatePullRequest(options git.PullRequestOptions) (git.PullRequestInfo, error)
- func (m *MockGitClient) CreateTag(name, message string) error
- func (m *MockGitClient) DeleteBranch(name string) error
- func (m *MockGitClient) Fetch(remote string) error
- func (m *MockGitClient) GetCallLog() []string
- func (m *MockGitClient) GetCommitCount() int
- func (m *MockGitClient) GetCommitHistory(options git.LogOptions) ([]git.CommitInfo, error)
- func (m *MockGitClient) GetCommits() []string
- func (m *MockGitClient) GetCurrentBranch() (string, error)
- func (m *MockGitClient) GetDiff(options git.DiffOptions) (string, error)
- func (m *MockGitClient) GetFileContent(path string) ([]byte, error)
- func (m *MockGitClient) GetFileContentString(filePath string) string
- func (m *MockGitClient) GetLastCommitHash() string
- func (m *MockGitClient) GetLog(options git.LogOptions) ([]git.CommitInfo, error)
- func (m *MockGitClient) GetPullRequestStatus(id int) (string, error)
- func (m *MockGitClient) GetRemotes() ([]git.RemoteInfo, error)
- func (m *MockGitClient) GetStatus() ([]git.StatusInfo, error)
- func (m *MockGitClient) GetTagInfo(name string) (git.TagInfo, error)
- func (m *MockGitClient) InitRepo() error
- func (m *MockGitClient) ListBranches() ([]string, error)
- func (m *MockGitClient) ListTags() ([]git.TagInfo, error)
- func (m *MockGitClient) MergeBranch(sourceBranch, targetBranch string) error
- func (m *MockGitClient) MergePullRequest(id int) error
- func (m *MockGitClient) Move(oldPath, newPath string) error
- func (m *MockGitClient) Pull(remote string) error
- func (m *MockGitClient) Push(remote string) error
- func (m *MockGitClient) RebaseBranch(sourceBranch, targetBranch string) error
- func (m *MockGitClient) Remove(path string) error
- func (m *MockGitClient) RemoveDirectory(path, commitMessage string) error
- func (m *MockGitClient) RemoveRemote(name string) error
- func (m *MockGitClient) Reset(options git.ResetOptions) error
- func (m *MockGitClient) ResetMock()
- func (m *MockGitClient) Restore(path string) error
- func (m *MockGitClient) SetCommitHash(hash string)
- func (m *MockGitClient) SetCommitPushError(err error)
- func (m *MockGitClient) SetInitError(err error)
- func (m *MockGitClient) SwitchBranch(name string) error
- type MockGitClientComprehensive
- type MockGitClientInterface
- type MockLLMClient
- func (m *MockLLMClient) Close() error
- func (m *MockLLMClient) EstimateTokens(text string) int
- func (m *MockLLMClient) GetCallCount() int
- func (m *MockLLMClient) GetEndpoint() string
- func (m *MockLLMClient) GetError() error
- func (m *MockLLMClient) GetLastIntent() string
- func (m *MockLLMClient) GetMaxTokens(modelName string) int
- func (m *MockLLMClient) GetModelCapabilities() shared.ModelCapabilities
- func (m *MockLLMClient) GetStatus() shared.ClientStatus
- func (m *MockLLMClient) GetSupportedModels() []string
- func (m *MockLLMClient) HealthCheck(ctx context.Context) error
- func (m *MockLLMClient) ProcessIntent(ctx context.Context, intent string) (string, error)
- func (m *MockLLMClient) ProcessIntentStream(ctx context.Context, prompt string, chunks chan<- *shared.StreamingChunk) error
- func (m *MockLLMClient) ProcessRequest(ctx context.Context, request *shared.LLMRequest) (*shared.LLMResponse, error)
- func (m *MockLLMClient) ProcessStreamingRequest(ctx context.Context, request *shared.LLMRequest) (<-chan *shared.StreamingChunk, error)
- func (m *MockLLMClient) ResetMock()
- func (m *MockLLMClient) SetError(intent string, err error)
- func (m *MockLLMClient) SetProcessingDelay(delay time.Duration)
- func (m *MockLLMClient) SetResponse(intent, response string)
- func (m *MockLLMClient) SetShouldReturnError(shouldError bool)
- func (m *MockLLMClient) ValidateModel(modelName string) error
- type MockLLMClientInterface
- type NetworkIntentFixture
- type OptimizedTestRunner
- type TestContext
- func (tc *TestContext) AddCleanup(fn func())
- func (tc *TestContext) Cleanup()
- func (tc *TestContext) CreateTempFile(name string, content []byte) string
- func (tc *TestContext) CreateTempFiles(files map[string][]byte) map[string]string
- func (tc *TestContext) GetOptimizedContext(baseTimeout time.Duration) (context.Context, context.CancelFunc)
- type TestMetricsCollector
- type TestResourcePool
- func (p *TestResourcePool) CacheDirectory(key, path string)
- func (p *TestResourcePool) CacheFile(path string, content []byte)
- func (p *TestResourcePool) Clear()
- func (p *TestResourcePool) GetCachedDirectory(key string) (string, bool)
- func (p *TestResourcePool) GetCachedFile(path string) ([]byte, bool)
- type WindowsConcurrencyManager
- type WindowsFileSystemOptimizer
- type WindowsPathNormalizer
- type WindowsTestOptimizer
- func (w *WindowsTestOptimizer) BulkFileCreation(baseDir string, files map[string][]byte) error
- func (w *WindowsTestOptimizer) Cleanup()
- func (w *WindowsTestOptimizer) OptimizedContextTimeout(ctx context.Context, baseTimeout time.Duration) (context.Context, context.CancelFunc)
- func (w *WindowsTestOptimizer) OptimizedFileRead(filePath string) ([]byte, error)
- func (w *WindowsTestOptimizer) OptimizedFileWrite(filePath string, content []byte) error
- func (w *WindowsTestOptimizer) OptimizedTempDir(t testing.TB, prefix string) string
- func (w *WindowsTestOptimizer) OptimizedTestTimeout(baseTimeout time.Duration) time.Duration
Constants ¶
const TestInterval = 250 * time.Millisecond
const TestTimeout = 30 * time.Second
Variables ¶
var E2NodeSetFixtures = []E2NodeSetFixture{ { Name: "test-e2nodeset-small", Namespace: "default", Replicas: 1, Expected: nephoranv1.E2NodeSetStatus{ ReadyReplicas: 1, }, }, { Name: "test-e2nodeset-medium", Namespace: "o-ran", Replicas: 3, Expected: nephoranv1.E2NodeSetStatus{ ReadyReplicas: 3, }, }, { Name: "test-e2nodeset-large", Namespace: "o-ran", Replicas: 5, Expected: nephoranv1.E2NodeSetStatus{ ReadyReplicas: 5, }, }, { Name: "test-e2nodeset-ha", Namespace: "o-ran-ha", Replicas: 7, Expected: nephoranv1.E2NodeSetStatus{ ReadyReplicas: 7, }, }, }
var NetworkIntentFixtures = []NetworkIntentFixture{ { Name: "upf-deployment", Namespace: "5g-core", Intent: "Deploy UPF with 3 replicas for high availability", Expected: nephoranv1.NetworkIntentSpec{ Intent: "Deploy UPF with 3 replicas for high availability", }, }, { Name: "amf-scaling", Namespace: "5g-core", Intent: "Scale AMF instances to 5 replicas to handle increased signaling load", Expected: nephoranv1.NetworkIntentSpec{ Intent: "Scale AMF instances to 5 replicas to handle increased signaling load", }, }, { Name: "near-rt-ric-deployment", Namespace: "o-ran", Intent: "Set up Near-RT RIC with xApp support for intelligent traffic management", Expected: nephoranv1.NetworkIntentSpec{ Intent: "Set up Near-RT RIC with xApp support for intelligent traffic management", }, }, { Name: "edge-computing-node", Namespace: "edge-apps", Intent: "Configure edge computing node with GPU acceleration for video processing", Expected: nephoranv1.NetworkIntentSpec{ Intent: "Configure edge computing node with GPU acceleration for video processing", }, }, { Name: "upf-vertical-scaling", Namespace: "5g-core", Intent: "Increase UPF resources to 4 CPU cores and 8GB memory for high throughput", Expected: nephoranv1.NetworkIntentSpec{ Intent: "Increase UPF resources to 4 CPU cores and 8GB memory for high throughput", }, }, }
Functions ¶
func AcquireConcurrencySlot ¶
func AcquireConcurrencySlot(testName string) func()
func AssertNetworkIntentHasCondition ¶
func AssertNetworkIntentHasCondition(ni *nephoranv1.NetworkIntent, conditionType string, status metav1.ConditionStatus, reason string)
func CleanupGlobalOptimizers ¶
func CleanupGlobalOptimizers()
func CleanupIsolatedNamespace ¶
func CleanupIsolatedNamespace(namespaceName string)
CleanupIsolatedNamespace cleans up resources in an isolated test namespace.
func CleanupTestResources ¶
func CreateConfigMap ¶
func CreateDeployedNetworkIntent ¶
func CreateDeployedNetworkIntent(fixture NetworkIntentFixture) *nephoranv1.NetworkIntent
func CreateE2NodeSet ¶
func CreateE2NodeSet(fixture E2NodeSetFixture) *nephoranv1.E2NodeSet
func CreateE2NodeSetWithCustomEndpoint ¶
func CreateE2NodeSetWithCustomEndpoint(name, namespace string, replicas int32, ricEndpoint string) *nephoranv1.E2NodeSet
func CreateIsolatedNamespace ¶
CreateIsolatedNamespace creates an isolated namespace for testing.
func CreateMinimalE2NodeSet ¶
func CreateMinimalE2NodeSet(name, namespace string, replicas int32) *nephoranv1.E2NodeSet
func CreateNamespace ¶
func CreateNetworkIntent ¶
func CreateNetworkIntent(fixture NetworkIntentFixture) *nephoranv1.NetworkIntent
func CreateProcessedNetworkIntent ¶
func CreateProcessedNetworkIntent(fixture NetworkIntentFixture) *nephoranv1.NetworkIntent
func CreateReadyE2NodeSet ¶
func CreateReadyE2NodeSet(fixture E2NodeSetFixture) *nephoranv1.E2NodeSet
func CreateTestContext ¶
func CreateTestContext() (context.Context, context.CancelFunc)
func CreateTestNamespace ¶
CreateTestNamespace creates a test namespace with auto-generated name.
func CreateTestNetworkIntent ¶
func CreateTestNetworkIntent(name, namespace, intent string) *nephoranv1.NetworkIntent
CreateTestNetworkIntent creates a NetworkIntent for testing with custom intent text.
func CreateTestSecret ¶
func DeleteConfigMap ¶
func DeleteNamespace ¶
func ExampleOptimizedCleanup ¶
func ExampleOptimizedTimeout ¶
func ExampleStandardCleanup ¶
func ExampleStandardTestData ¶
func ExampleStandardTimeout ¶
func GenerateUniqueName ¶
func GenerateUniqueNamespace ¶
func GetE2NodeSet ¶
func GetE2NodeSet(ctx context.Context, k8sClient client.Client, namespacedName types.NamespacedName) *nephoranv1.E2NodeSet
func GetE2NodeSetByLabels ¶
func GetE2NodeSetConfigMaps ¶
func GetE2NodeSetConfigMaps(ctx context.Context, k8sClient client.Client, e2nodeSet *nephoranv1.E2NodeSet) (*corev1.ConfigMapList, error)
func GetNetworkIntent ¶
func GetNetworkIntent(ctx context.Context, k8sClient client.Client, namespacedName types.NamespacedName) *nephoranv1.NetworkIntent
func GetOptimizedContext ¶
func GetResourceCounts ¶
func GetUniqueName ¶
GetUniqueName generates a unique name for test resources.
func IsConditionTrue ¶
IsConditionTrue checks if a condition is true in a list of conditions.
func NormalizePath ¶
func ReadFileOptimized ¶
func UpdateE2NodeSetReplicas ¶
func UpdateE2NodeSetStatus ¶
func UpdateNetworkIntentStatus ¶
func UpdateNetworkIntentStatus(ctx context.Context, k8sClient client.Client, ni *nephoranv1.NetworkIntent)
func VerifyOwnerReferences ¶
func WaitForConfigMapCount ¶
func WaitForE2NodeSetReady ¶
func WaitForE2NodeSetScaling ¶
func WaitForE2NodeSetStatusUpdate ¶
func WaitForE2NodeSetStatusUpdate(ctx context.Context, k8sClient client.Client, namespacedName types.NamespacedName, checkFunc func(*nephoranv1.E2NodeSet) bool)
func WaitForMultipleNetworkIntentsProcessed ¶
func WaitForMultipleNetworkIntentsProcessed(ctx context.Context, k8sClient client.Client, networkIntents []*nephoranv1.NetworkIntent)
func WaitForOwnerReferences ¶
func WaitForResourceDeletion ¶
func WithOptimizedTest ¶
func WithOptimizedTest(t *testing.T, testFunc func(*testing.T, *TestContext))
func WithOptimizedTimeout ¶
func WriteFileOptimized ¶
Types ¶
type BatchFileProcessor ¶
type BatchFileProcessor struct {
// contains filtered or unexported fields
}
func NewBatchFileProcessor ¶
func NewBatchFileProcessor() *BatchFileProcessor
func (*BatchFileProcessor) CreateFiles ¶
func (b *BatchFileProcessor) CreateFiles(baseDir string, files map[string][]byte) error
type E2NodeSetFixture ¶
type E2NodeSetFixture struct {
Name string
Namespace string
Replicas int32
Expected nephoranv1.E2NodeSetStatus
}
func GetE2NodeSetByName ¶
func GetE2NodeSetByName(name string) *E2NodeSetFixture
type EnhancedMockGitClient ¶
type EnhancedMockGitClient = MockGitClient
func NewEnhancedMockGitClient ¶
func NewEnhancedMockGitClient() *EnhancedMockGitClient
type MockDependencies ¶
type MockDependencies struct {
LLMClient *MockLLMClient
GitClient *MockGitClient
}
func (*MockDependencies) GetEventRecorder ¶
func (m *MockDependencies) GetEventRecorder() record.EventRecorder
func (*MockDependencies) GetGitClient ¶
func (m *MockDependencies) GetGitClient() git.ClientInterface
func (*MockDependencies) GetHTTPClient ¶
func (m *MockDependencies) GetHTTPClient() *http.Client
func (*MockDependencies) GetLLMClient ¶
func (m *MockDependencies) GetLLMClient() shared.ClientInterface
func (*MockDependencies) GetMetricsCollector ¶
func (m *MockDependencies) GetMetricsCollector() monitoring.MetricsCollector
func (*MockDependencies) GetPackageGenerator ¶
func (m *MockDependencies) GetPackageGenerator() *nephio.PackageGenerator
func (*MockDependencies) GetTelecomKnowledgeBase ¶
func (m *MockDependencies) GetTelecomKnowledgeBase() *telecom.TelecomKnowledgeBase
type MockDependenciesBuilder ¶
type MockDependenciesBuilder struct {
// contains filtered or unexported fields
}
func NewMockDependenciesBuilder ¶
func NewMockDependenciesBuilder() *MockDependenciesBuilder
func (*MockDependenciesBuilder) Build ¶
func (b *MockDependenciesBuilder) Build() *MockDependencies
func (*MockDependenciesBuilder) WithGitClient ¶
func (b *MockDependenciesBuilder) WithGitClient(client *MockGitClient) *MockDependenciesBuilder
func (*MockDependenciesBuilder) WithLLMClient ¶
func (b *MockDependenciesBuilder) WithLLMClient(client *MockLLMClient) *MockDependenciesBuilder
type MockDependenciesComprehensive ¶
type MockDependenciesComprehensive struct {
// contains filtered or unexported fields
}
type MockGitClient ¶
type MockGitClient struct {
// contains filtered or unexported fields
}
func NewMockGitClient ¶
func NewMockGitClient() *MockGitClient
func (*MockGitClient) Add ¶
func (m *MockGitClient) Add(path string) error
func (*MockGitClient) AddRemote ¶
func (m *MockGitClient) AddRemote(name, url string) error
func (*MockGitClient) ApplyPatch ¶
func (m *MockGitClient) ApplyPatch(patch string) error
func (*MockGitClient) ApprovePullRequest ¶
func (m *MockGitClient) ApprovePullRequest(id int) error
func (*MockGitClient) CherryPick ¶
func (m *MockGitClient) CherryPick(commitHash string) error
func (*MockGitClient) Clean ¶
func (m *MockGitClient) Clean(force bool) error
func (*MockGitClient) CommitAndPush ¶
func (*MockGitClient) CommitAndPushChanges ¶
func (m *MockGitClient) CommitAndPushChanges(message string) error
func (*MockGitClient) CommitFiles ¶
func (m *MockGitClient) CommitFiles(files []string, msg string) error
func (*MockGitClient) CreateBranch ¶
func (m *MockGitClient) CreateBranch(name string) error
func (*MockGitClient) CreatePatch ¶
func (m *MockGitClient) CreatePatch(options git.DiffOptions) (string, error)
func (*MockGitClient) CreatePullRequest ¶
func (m *MockGitClient) CreatePullRequest(options git.PullRequestOptions) (git.PullRequestInfo, error)
func (*MockGitClient) CreateTag ¶
func (m *MockGitClient) CreateTag(name, message string) error
func (*MockGitClient) DeleteBranch ¶
func (m *MockGitClient) DeleteBranch(name string) error
func (*MockGitClient) Fetch ¶
func (m *MockGitClient) Fetch(remote string) error
func (*MockGitClient) GetCallLog ¶
func (m *MockGitClient) GetCallLog() []string
func (*MockGitClient) GetCommitCount ¶
func (m *MockGitClient) GetCommitCount() int
func (*MockGitClient) GetCommitHistory ¶
func (m *MockGitClient) GetCommitHistory(options git.LogOptions) ([]git.CommitInfo, error)
func (*MockGitClient) GetCommits ¶
func (m *MockGitClient) GetCommits() []string
func (*MockGitClient) GetCurrentBranch ¶
func (m *MockGitClient) GetCurrentBranch() (string, error)
func (*MockGitClient) GetDiff ¶
func (m *MockGitClient) GetDiff(options git.DiffOptions) (string, error)
func (*MockGitClient) GetFileContent ¶
func (m *MockGitClient) GetFileContent(path string) ([]byte, error)
func (*MockGitClient) GetFileContentString ¶
func (m *MockGitClient) GetFileContentString(filePath string) string
func (*MockGitClient) GetLastCommitHash ¶
func (m *MockGitClient) GetLastCommitHash() string
func (*MockGitClient) GetLog ¶
func (m *MockGitClient) GetLog(options git.LogOptions) ([]git.CommitInfo, error)
func (*MockGitClient) GetPullRequestStatus ¶
func (m *MockGitClient) GetPullRequestStatus(id int) (string, error)
func (*MockGitClient) GetRemotes ¶
func (m *MockGitClient) GetRemotes() ([]git.RemoteInfo, error)
func (*MockGitClient) GetStatus ¶
func (m *MockGitClient) GetStatus() ([]git.StatusInfo, error)
func (*MockGitClient) GetTagInfo ¶
func (m *MockGitClient) GetTagInfo(name string) (git.TagInfo, error)
func (*MockGitClient) InitRepo ¶
func (m *MockGitClient) InitRepo() error
func (*MockGitClient) ListBranches ¶
func (m *MockGitClient) ListBranches() ([]string, error)
func (*MockGitClient) MergeBranch ¶
func (m *MockGitClient) MergeBranch(sourceBranch, targetBranch string) error
func (*MockGitClient) MergePullRequest ¶
func (m *MockGitClient) MergePullRequest(id int) error
func (*MockGitClient) Move ¶
func (m *MockGitClient) Move(oldPath, newPath string) error
func (*MockGitClient) Pull ¶
func (m *MockGitClient) Pull(remote string) error
func (*MockGitClient) Push ¶
func (m *MockGitClient) Push(remote string) error
func (*MockGitClient) RebaseBranch ¶
func (m *MockGitClient) RebaseBranch(sourceBranch, targetBranch string) error
func (*MockGitClient) Remove ¶
func (m *MockGitClient) Remove(path string) error
func (*MockGitClient) RemoveDirectory ¶
func (m *MockGitClient) RemoveDirectory(path, commitMessage string) error
func (*MockGitClient) RemoveRemote ¶
func (m *MockGitClient) RemoveRemote(name string) error
func (*MockGitClient) Reset ¶
func (m *MockGitClient) Reset(options git.ResetOptions) error
func (*MockGitClient) ResetMock ¶
func (m *MockGitClient) ResetMock()
func (*MockGitClient) Restore ¶
func (m *MockGitClient) Restore(path string) error
func (*MockGitClient) SetCommitHash ¶
func (m *MockGitClient) SetCommitHash(hash string)
func (*MockGitClient) SetCommitPushError ¶
func (m *MockGitClient) SetCommitPushError(err error)
func (*MockGitClient) SetInitError ¶
func (m *MockGitClient) SetInitError(err error)
func (*MockGitClient) SwitchBranch ¶
func (m *MockGitClient) SwitchBranch(name string) error
type MockGitClientComprehensive ¶
type MockGitClientComprehensive = MockGitClient
type MockGitClientInterface ¶
type MockGitClientInterface = MockGitClient
type MockLLMClient ¶
type MockLLMClient struct {
Error error // Public field for direct error control in tests
// contains filtered or unexported fields
}
func NewMockLLMClient ¶
func NewMockLLMClient() *MockLLMClient
func (*MockLLMClient) Close ¶
func (m *MockLLMClient) Close() error
func (*MockLLMClient) EstimateTokens ¶
func (m *MockLLMClient) EstimateTokens(text string) int
func (*MockLLMClient) GetCallCount ¶
func (m *MockLLMClient) GetCallCount() int
func (*MockLLMClient) GetEndpoint ¶
func (m *MockLLMClient) GetEndpoint() string
GetEndpoint implements the shared.ClientInterface.
func (*MockLLMClient) GetError ¶
func (m *MockLLMClient) GetError() error
func (*MockLLMClient) GetLastIntent ¶
func (m *MockLLMClient) GetLastIntent() string
func (*MockLLMClient) GetMaxTokens ¶
func (m *MockLLMClient) GetMaxTokens(modelName string) int
func (*MockLLMClient) GetModelCapabilities ¶
func (m *MockLLMClient) GetModelCapabilities() shared.ModelCapabilities
GetModelCapabilities implements the shared.ClientInterface.
func (*MockLLMClient) GetStatus ¶
func (m *MockLLMClient) GetStatus() shared.ClientStatus
GetStatus implements the shared.ClientInterface.
func (*MockLLMClient) GetSupportedModels ¶
func (m *MockLLMClient) GetSupportedModels() []string
func (*MockLLMClient) HealthCheck ¶
func (m *MockLLMClient) HealthCheck(ctx context.Context) error
HealthCheck implements the shared.ClientInterface.
func (*MockLLMClient) ProcessIntent ¶
func (*MockLLMClient) ProcessIntentStream ¶
func (m *MockLLMClient) ProcessIntentStream(ctx context.Context, prompt string, chunks chan<- *shared.StreamingChunk) error
func (*MockLLMClient) ProcessRequest ¶
func (m *MockLLMClient) ProcessRequest(ctx context.Context, request *shared.LLMRequest) (*shared.LLMResponse, error)
ProcessRequest implements the shared.ClientInterface.
func (*MockLLMClient) ProcessStreamingRequest ¶
func (m *MockLLMClient) ProcessStreamingRequest(ctx context.Context, request *shared.LLMRequest) (<-chan *shared.StreamingChunk, error)
ProcessStreamingRequest implements the shared.ClientInterface.
func (*MockLLMClient) ResetMock ¶
func (m *MockLLMClient) ResetMock()
func (*MockLLMClient) SetError ¶
func (m *MockLLMClient) SetError(intent string, err error)
func (*MockLLMClient) SetProcessingDelay ¶
func (m *MockLLMClient) SetProcessingDelay(delay time.Duration)
func (*MockLLMClient) SetResponse ¶
func (m *MockLLMClient) SetResponse(intent, response string)
func (*MockLLMClient) SetShouldReturnError ¶
func (m *MockLLMClient) SetShouldReturnError(shouldError bool)
func (*MockLLMClient) ValidateModel ¶
func (m *MockLLMClient) ValidateModel(modelName string) error
type MockLLMClientInterface ¶
type MockLLMClientInterface = MockLLMClient
type NetworkIntentFixture ¶
type NetworkIntentFixture struct {
Name string
Namespace string
Intent string
Expected nephoranv1.NetworkIntentSpec
}
func GetNetworkIntentByName ¶
func GetNetworkIntentByName(name string) *NetworkIntentFixture
type OptimizedTestRunner ¶
type OptimizedTestRunner struct {
// contains filtered or unexported fields
}
func NewOptimizedTestRunner ¶
func NewOptimizedTestRunner() *OptimizedTestRunner
func (*OptimizedTestRunner) RunOptimizedTest ¶
func (r *OptimizedTestRunner) RunOptimizedTest(t *testing.T, testFunc func(*testing.T, *TestContext))
type TestContext ¶
type TestContext struct {
T *testing.T
TempDir string
Optimizer *WindowsTestOptimizer
BatchProc *BatchFileProcessor
ResourceMgr *TestResourcePool
// contains filtered or unexported fields
}
func (*TestContext) AddCleanup ¶
func (tc *TestContext) AddCleanup(fn func())
func (*TestContext) Cleanup ¶
func (tc *TestContext) Cleanup()
func (*TestContext) CreateTempFile ¶
func (tc *TestContext) CreateTempFile(name string, content []byte) string
func (*TestContext) CreateTempFiles ¶
func (tc *TestContext) CreateTempFiles(files map[string][]byte) map[string]string
func (*TestContext) GetOptimizedContext ¶
func (tc *TestContext) GetOptimizedContext(baseTimeout time.Duration) (context.Context, context.CancelFunc)
type TestMetricsCollector ¶
type TestMetricsCollector struct {
// contains filtered or unexported fields
}
func NewTestMetricsCollector ¶
func NewTestMetricsCollector() *TestMetricsCollector
func (*TestMetricsCollector) GetAverageDuration ¶
func (m *TestMetricsCollector) GetAverageDuration(prefix string) time.Duration
func (*TestMetricsCollector) PrintSummary ¶
func (m *TestMetricsCollector) PrintSummary()
func (*TestMetricsCollector) RecordTestCompletion ¶
func (m *TestMetricsCollector) RecordTestCompletion(testName string, duration time.Duration)
type TestResourcePool ¶
type TestResourcePool struct {
// contains filtered or unexported fields
}
func NewTestResourcePool ¶
func NewTestResourcePool() *TestResourcePool
func (*TestResourcePool) CacheDirectory ¶
func (p *TestResourcePool) CacheDirectory(key, path string)
func (*TestResourcePool) CacheFile ¶
func (p *TestResourcePool) CacheFile(path string, content []byte)
func (*TestResourcePool) Clear ¶
func (p *TestResourcePool) Clear()
func (*TestResourcePool) GetCachedDirectory ¶
func (p *TestResourcePool) GetCachedDirectory(key string) (string, bool)
func (*TestResourcePool) GetCachedFile ¶
func (p *TestResourcePool) GetCachedFile(path string) ([]byte, bool)
type WindowsConcurrencyManager ¶
type WindowsConcurrencyManager struct {
// contains filtered or unexported fields
}
func NewWindowsConcurrencyManager ¶
func NewWindowsConcurrencyManager() *WindowsConcurrencyManager
func (*WindowsConcurrencyManager) AcquireSlot ¶
func (w *WindowsConcurrencyManager) AcquireSlot(testName string) func()
func (*WindowsConcurrencyManager) GetActiveTests ¶
func (w *WindowsConcurrencyManager) GetActiveTests() int
type WindowsFileSystemOptimizer ¶
type WindowsFileSystemOptimizer struct {
// contains filtered or unexported fields
}
func NewWindowsFileSystemOptimizer ¶
func NewWindowsFileSystemOptimizer() *WindowsFileSystemOptimizer
type WindowsPathNormalizer ¶
type WindowsPathNormalizer struct {
// contains filtered or unexported fields
}
func NewWindowsPathNormalizer ¶
func NewWindowsPathNormalizer() *WindowsPathNormalizer
func (*WindowsPathNormalizer) GetShortPath ¶
func (w *WindowsPathNormalizer) GetShortPath(path string) string
func (*WindowsPathNormalizer) NormalizePath ¶
func (w *WindowsPathNormalizer) NormalizePath(path string) string
type WindowsTestOptimizer ¶
type WindowsTestOptimizer struct {
// contains filtered or unexported fields
}
func NewWindowsTestOptimizer ¶
func NewWindowsTestOptimizer() *WindowsTestOptimizer
func (*WindowsTestOptimizer) BulkFileCreation ¶
func (w *WindowsTestOptimizer) BulkFileCreation(baseDir string, files map[string][]byte) error
func (*WindowsTestOptimizer) Cleanup ¶
func (w *WindowsTestOptimizer) Cleanup()
func (*WindowsTestOptimizer) OptimizedContextTimeout ¶
func (w *WindowsTestOptimizer) OptimizedContextTimeout(ctx context.Context, baseTimeout time.Duration) (context.Context, context.CancelFunc)
func (*WindowsTestOptimizer) OptimizedFileRead ¶
func (w *WindowsTestOptimizer) OptimizedFileRead(filePath string) ([]byte, error)
func (*WindowsTestOptimizer) OptimizedFileWrite ¶
func (w *WindowsTestOptimizer) OptimizedFileWrite(filePath string, content []byte) error
func (*WindowsTestOptimizer) OptimizedTempDir ¶
func (w *WindowsTestOptimizer) OptimizedTempDir(t testing.TB, prefix string) string
func (*WindowsTestOptimizer) OptimizedTestTimeout ¶
func (w *WindowsTestOptimizer) OptimizedTestTimeout(baseTimeout time.Duration) time.Duration