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>
This commit is contained in:
Aleksei SviridkinandClaude committed 2025-11-08 18:18:42 +03:00 Unverified
1 parent e34c0dbb61
commit 697cf41711
14 files changed
+120 -92

No files matched your search

@@ -8,9 +8,9 @@ tests:
- it: should use default image repository
asserts:
- equal:
- matchRegex:
path: spec.template.spec.containers[0].image
value: jellyfin/jellyfin:RELEASE-VERSION
pattern: "^docker\\.io/jellyfin/jellyfin:"
- it: should use custom image repository
set:
@@ -36,7 +36,7 @@ tests:
asserts:
- matchRegex:
path: spec.template.spec.containers[0].image
pattern: ":RELEASE-VERSION$"
pattern: ":[0-9]+\\.[0-9]+\\.[0-9]+$"
- it: should use custom tag when specified
set:
@@ -44,7 +44,7 @@ tests:
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: jellyfin/jellyfin:10.8.13
value: docker.io/jellyfin/jellyfin:10.8.13
- it: should support latest tag
set:
@@ -52,7 +52,7 @@ tests:
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: jellyfin/jellyfin:latest
value: docker.io/jellyfin/jellyfin:latest
- it: should support beta tags
set:
@@ -60,7 +60,7 @@ tests:
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: jellyfin/jellyfin:10.9.0-beta1
value: docker.io/jellyfin/jellyfin:10.9.0-beta1
- it: should support sha256 digest
set:
@@ -68,7 +68,7 @@ tests:
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: jellyfin/jellyfin:sha256:abc123def456
value: docker.io/jellyfin/jellyfin:sha256:abc123def456
- it: should combine custom repository and tag
set:
@@ -198,7 +198,7 @@ tests:
asserts:
- matchRegex:
path: spec.template.spec.containers[0].image
pattern: :RELEASE-VERSION$
pattern: ":[0-9]+\\.[0-9]+\\.[0-9]+$"
# =============================================================================
# COMPLETE SCENARIOS
@@ -283,7 +283,7 @@ tests:
asserts:
- matchRegex:
path: spec.template.spec.containers[0].image
pattern: ^jellyfin/jellyfin:RELEASE-VERSION$
pattern: '^docker\.io/jellyfin/jellyfin:[0-9]+\.[0-9]+\.[0-9]+$'
- it: should not have imagePullSecrets when not specified
asserts: