Commit Graph
2 Commits
  • fix(tests): fix all helm-unittest test failures
    Fixed comprehensive test suite to achieve 100% pass rate (603/603 tests).
    
    Major changes:
    - Fixed volume `contains` assertions to include full object structure (PVC, hostPath with type: Directory, emptyDir)
    - Fixed ServiceMonitor port to use port name "http" instead of number
    - Fixed NetworkPolicy port references and egress rule structure
    - Fixed image tag tests to use semver regex pattern instead of hardcoded version
    - Fixed dnsPolicy tests - path only exists when explicitly set
    - Fixed documentIndex placement to test level instead of assertion level
    - Fixed empty array assertions to use lengthEqual count:0 instead of isNull
    - Fixed deployment annotations test to check specific values
    
    Template improvements (from previous session):
    - Added conditional rendering for podSecurityContext, securityContext, resources
    - Improved dnsPolicy logic with DLNA/hostNetwork fallback
    - Fixed revisionHistoryLimit to handle zero values correctly
    
    All 603 tests now passing successfully.
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    Signed-off-by: Aleksei Sviridkin <f@lex.la>
  • test(charts): add deployment parameter tests and validation suite
    Phase 3: Create comprehensive tests for remaining deployment parameters
    and validation of mutual exclusions.
    
    New test files:
    - deployment_resources_test.yaml: Resources (CPU/memory/GPU), extra volumes,
      volume mounts, sidecar containers (70+ tests)
    - deployment_image_test.yaml: Image repository, tag, pullPolicy,
      imagePullSecrets for various registries (60+ tests)
    - deployment_jellyfin_test.yaml: Jellyfin-specific config including DLNA,
      metrics lifecycle hooks, command/args/env variables (70+ tests)
    - deployment_metadata_test.yaml: Names, labels, annotations, deployment
      strategy, revision history, replica count (70+ tests)
    - validation_mutual_exclusions_test.yaml: Critical validation tests using
      failedTemplate for NetworkPolicy conflicts, ServiceMonitor dependencies,
      persistence validations, port ranges (80+ tests)
    
    Critical validations tested:
    - NetworkPolicy vs DLNA/hostNetwork mutual exclusion (failedTemplate)
    - ServiceMonitor requires both metrics.enabled AND serviceMonitor.enabled
    - DLNA automatically enables hostNetwork and sets correct dnsPolicy
    - Persistence type validations (pvc/hostPath/emptyDir)
    - Port range validations (service.port: 1-65535, nodePort: 30000-32767)
    - DNS policy automatic configuration based on hostNetwork
    
    Edge cases covered:
    - Empty configuration arrays/objects
    - Multiple image pull secrets
    - Various env variable types (value, secretKeyRef, configMapKeyRef, fieldRef)
    - GPU and ephemeral-storage resources
    - All service types (ClusterIP, NodePort, LoadBalancer, ExternalName)
    
    Total: 5 new test files, 350+ new test cases
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    Signed-off-by: Aleksei Sviridkin <f@lex.la>