Skip to content

Commit d593ad3

Browse files
committed
fix(tests): Round 25 - Fix 3 compilation errors
1. MockObservabilityStack.MeasureQueryPerformance method: - Added missing interface method MeasureQueryPerformance - Takes query string and TimeRange parameters - Returns *PerformanceMetrics and error - Completes ObservabilityStackInterface implementation 2. NephioPackager.ValidatePackage call: - Method signature requires context.Context as first parameter - Changed from ValidatePackage(pkg) to ValidatePackage(context.Background(), pkg) - Matches actual method: ValidatePackage(ctx context.Context, pkg *NephioPackage) error 3. O2DMSClient.RetryCount field: - Field doesn't exist in O2DMSClient struct - Changed RetryCount to maxRetries (actual field name) - Added retryDelay field initialization - Matches struct definition: maxRetries int, retryDelay time.Duration Errors fixed: 3 total Total errors fixed across all 25 rounds: 128
1 parent e63f075 commit d593ad3

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

adapters/vnf-operator/pkg/dms/o2_client_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ func TestO2DMSClient_RetryLogic(t *testing.T) {
428428
Endpoint: "http://test-o2dms:8080",
429429
Token: "test-token",
430430
httpClient: &http.Client{Transport: mockHTTP},
431-
RetryCount: tt.retryCount,
431+
maxRetries: tt.retryCount,
432+
retryDelay: time.Second,
432433
}
433434

434435
// This method doesn't exist yet - will cause test to fail

adapters/vnf-operator/pkg/translator/nephio_packager_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func TestNephioPackager_ValidatePackage(t *testing.T) {
406406
t.Run(tt.name, func(t *testing.T) {
407407
packager := &NephioPackager{}
408408

409-
err := packager.ValidatePackage(tt.pkg)
409+
err := packager.ValidatePackage(context.Background(), tt.pkg)
410410

411411
if tt.expectedError {
412412
assert.Error(t, err)

adapters/vnf-operator/tests/monitoring/e2e_observability_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ func (m *MockObservabilityStack) EvaluateAlerts(rules []AlertRule) ([]Alert, err
7777
return args.Get(0).([]Alert), args.Error(1)
7878
}
7979

80+
func (m *MockObservabilityStack) MeasureQueryPerformance(query string, timeRange TimeRange) (*PerformanceMetrics, error) {
81+
args := m.Called(query, timeRange)
82+
if args.Get(0) == nil {
83+
return nil, args.Error(1)
84+
}
85+
return args.Get(0).(*PerformanceMetrics), args.Error(1)
86+
}
87+
8088
func (m *MockObservabilityStack) ValidateStack() (*StackValidation, error) {
8189
args := m.Called()
8290
if args.Get(0) == nil {

0 commit comments

Comments
 (0)