This document summarizes all changes made to upgrade the StackStorm Kubernetes Helm chart from using an outdated version of helm-unittest (v0.2.11 from quintush/helm-unittest) to the latest version (v0.5.1 from helm-unittest/helm-unittest).
- Old:
https://github.com/quintush/helm-unittest - New:
https://github.com/helm-unittest/helm-unittest.git
The upstream repository for helm-unittest has moved from a community fork (quintush) to the official helm-unittest organization.
Files Updated:
.github/workflows/unit.yaml- GitHub Actions CI/CD workflowtests/README.md- Documentation
- Old: v0.2.11
- New: v0.5.1
The upgrade introduces several breaking changes and new features:
- v0.3.0: Added JSONPath support (critical for updating test syntax)
- v0.4.x: Refactored assertion functions with clearer naming
- v0.5.x: Additional improvements and bug fixes
Files Updated:
.github/workflows/unit.yaml- CI/CD workflow versiontests/README.md- Installation instructions
The new version requires paths to use jq-style bracket notation for keys containing special characters (dots, dashes, etc.).
Old Syntax:
path: metadata.labels.[app.kubernetes.io/name]New Syntax:
path: metadata.labels["app.kubernetes.io/name"]Numeric array indexing remains the same:
path: spec.template.spec.containers[0].imagePullPolicyFiles Updated: All test files in tests/unit/:
- custom_annotations_test.yaml
- dns_test.yaml
- env_test.yaml
- extra_volumes_test.yaml
- image_entrypoint_test.yaml
- image_pull_test.yaml
- image_test.yaml
- ingress_test.yaml
- labels_test.yaml
- overrides_test.yaml
- packs_volumes_test.yaml
- placement_test.yaml
- post_start_script_test.yaml
- resources_test.yaml
- secrets_test.yaml
- security_context_test.yaml
- service_account_test.yaml
- services_test.yaml
- st2_conf_files_test.yaml
- st2sensors_test.yaml
The assertion functions were refactored in v0.3.2+ for clearer semantics:
| Old Function | New Function | Behavior |
|---|---|---|
isNull |
notExists |
Path does not exist |
isNotNull |
exists |
Path exists |
isEmpty |
isNullOrEmpty |
Path exists but is empty or "null" |
isNotEmpty |
isNotNullOrEmpty |
Path exists and is not empty |
Example:
# Old syntax
- isNotNull:
path: metadata.labels["app.kubernetes.io/name"]
# New syntax
- exists:
path: metadata.labels["app.kubernetes.io/name"]The old test suite would fail when imagePullSecrets was defined but empty. The fix involves conditionally including the entire imagePullSecrets block only when a pull secret is configured.
Old Pattern:
spec:
imagePullSecrets:
{{- if .Values.image.pullSecret }}
- name: {{ .Values.image.pullSecret }}
{{- end }}This resulted in an empty imagePullSecrets: key when no secret was configured.
New Pattern:
spec:
{{- if .Values.image.pullSecret }}
imagePullSecrets:
- name: {{ .Values.image.pullSecret }}
{{- end }}Files Updated:
templates/deployments.yaml- Updated 17 instancestemplates/jobs.yaml- Updated 7 instancestemplates/service-account.yaml- Updated 1 instance with proper indentation fix
tests/README.md:
- Updated helm-unittest repository reference from quintush to helm-unittest organization
- Updated installation command to use v0.5.1
- Updated documentation link to point to main branch (instead of master)
All unit tests pass with helm-unittest v0.5.1:
- 20 test suites
- 98 tests total
- All assertions use new syntax and functions
- All templates render correctly without empty keys
# Install helm-unittest v0.5.1
helm plugin install https://github.com/helm-unittest/helm-unittest.git --version v0.5.1
# Install chart dependencies
helm dependency update
# Run unit tests
helm unittest -f 'tests/unit/*_test.yaml' .This upgrade introduces breaking changes in the test syntax:
- Old helm-unittest versions (< v0.3.0) will not recognize the new JSONPath syntax
- Assertion functions from v0.2.x are considered deprecated in v0.3.0+
- GitHub Issue: #414 - Upgrade
helm-unittest - PR #417: Refactor unit tests to support unittests v0.4.4
- PR #421: Bump unittests to v0.5.1
- helm-unittest Repository
- helm-unittest Changelog