Skip to content

Commit 6a4a27e

Browse files
committed
fix: correct Python import sorting for isort compliance
- Alphabetically sort typing imports in run_intents.py - Fix isort validation in CI pipeline
1 parent 4842140 commit 6a4a27e

6 files changed

Lines changed: 1 addition & 91 deletions

File tree

nlp/run_intents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import re
2020
import sys
2121
from pathlib import Path
22-
from typing import Any, Dict, List, Optional, Tuple, TextIO, cast
22+
from typing import Any, Dict, List, Optional, TextIO, Tuple, cast
2323

2424
import jsonschema
2525

tests/integration/vnf_operator_integration_test.go

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -366,74 +366,9 @@ var _ = ginkgo.Describe("VNF Operator Performance", func() {
366366
})
367367

368368
// Test utilities for checking cluster connectivity
369-
func isClusterAvailable() bool { // nolint:unused // TODO: implement cluster connectivity checks
370-
home, _ := os.UserHomeDir()
371-
kubeconfig := filepath.Join(home, ".kube", "config")
372-
373-
if _, err := os.Stat(kubeconfig); os.IsNotExist(err) {
374-
return false
375-
}
376-
377-
config, err := clientcmd.BuildConfigFromFlags("", kubeconfig)
378-
if err != nil {
379-
return false
380-
}
381-
382-
client, err := client.New(config, client.Options{})
383-
if err != nil {
384-
return false
385-
}
386-
387-
// Try to list namespaces as a connectivity check
388-
namespaces := &corev1.NamespaceList{}
389-
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
390-
defer cancel()
391-
392-
err = client.List(ctx, namespaces)
393-
return err == nil
394-
}
395369

396370
// Test data generation helpers
397-
func generateTestData(dataType string) interface{} { // nolint:unused // TODO: implement test data generation
398-
switch dataType {
399-
case "vnf":
400-
return createTestVNF("generated-vnf", "default")
401-
case "qos":
402-
return vnfv1alpha1.QoSRequirements{
403-
Bandwidth: 10.0,
404-
Latency: 5.0,
405-
SliceType: "balanced",
406-
}
407-
default:
408-
return nil
409-
}
410-
}
411371

412372
// Validation helpers
413-
func validateVNFSpec(vnf *vnfv1alpha1.VNF) error { // nolint:unused // TODO: implement VNF spec validation
414-
v := reflect.ValueOf(vnf.Spec)
415-
t := v.Type()
416-
417-
for i := 0; i < v.NumField(); i++ {
418-
field := v.Field(i)
419-
fieldType := t.Field(i)
420-
421-
// Check for zero values in required fields
422-
if fieldType.Tag.Get("required") == "true" && field.IsZero() {
423-
return fmt.Errorf("required field %s is empty", fieldType.Name)
424-
}
425-
}
426-
427-
return nil
428-
}
429373

430374
// File system helpers for test artifacts
431-
func writeTestArtifact(filename string, content []byte) error { // nolint:unused // TODO: implement test artifact writing
432-
artifactDir := filepath.Join(".", "test-artifacts")
433-
if err := os.MkdirAll(artifactDir, security.PrivateDirMode); err != nil {
434-
return err
435-
}
436-
437-
filePath := filepath.Join(artifactDir, filename)
438-
return os.WriteFile(filePath, content, security.SecureFileMode)
439-
}

tests/performance/network_performance_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ func TestNetworkPerformance(t *testing.T) {
480480
// NetworkPerformanceSuite implementation
481481

482482
type NetworkPerformanceSuite struct {
483-
clientset kubernetes.Interface // nolint:unused // TODO: integrate with k8s client for performance tests
484483
testContext context.Context
485484
testCancel context.CancelFunc
486485
results []PerformanceMeasurement

tests/performance/qos_validation_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ type QoSMeasurement struct {
4141

4242
// QoSValidationSuite manages QoS parameter validation tests
4343
type QoSValidationSuite struct {
44-
clientset kubernetes.Interface // nolint:unused // TODO: integrate with k8s client for QoS validation
4544
testContext context.Context
4645
testCancel context.CancelFunc
4746
measurements []QoSMeasurement

tests/performance/thesis_validation_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ type PerformanceTestSuite struct {
5151
cancel context.CancelFunc
5252
framework *testutils.TestFramework
5353
prometheusClient v1.API
54-
testClusters []string // nolint:unused // TODO: implement multi-cluster performance tests
5554
thesisMetrics ThesisMetrics
5655
resultCollector *PerformanceResultCollector
5756
}

tests/security/benchmark_security_test.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,25 +1074,3 @@ func BenchmarkComparisonReport(b *testing.B) {
10741074
}
10751075

10761076
// calculatePerformanceScore calculates a performance score based on multiple metrics
1077-
func calculatePerformanceScore(results map[string]BenchmarkResult) float64 { // nolint:unused // TODO: implement performance scoring
1078-
if len(results) == 0 {
1079-
return 0.0
1080-
}
1081-
1082-
var totalScore float64
1083-
for _, result := range results {
1084-
// Score based on operations per second (higher is better)
1085-
opsScore := math.Log10(result.OpsPerSecond + 1)
1086-
1087-
// Penalty for high memory usage
1088-
memoryPenalty := math.Log10(float64(result.BytesPerOp + 1))
1089-
1090-
// Penalty for high allocation rate
1091-
allocPenalty := math.Log10(float64(result.AllocsPerOp + 1))
1092-
1093-
score := opsScore - (memoryPenalty * 0.1) - (allocPenalty * 0.1)
1094-
totalScore += score
1095-
}
1096-
1097-
return totalScore / float64(len(results))
1098-
}

0 commit comments

Comments
 (0)