Skip to content

test(application): helm-unittest suite for the application chart (PLATENG-1214) - #24

Merged
tokio-on-jupiter merged 3 commits into
mainfrom
PLATENG-1214/helm-unittest-suite
Sep 23, 2026
Merged

tokio-on-jupiter merged 3 commits into
mainfrom
PLATENG-1214/helm-unittest-suite

Conversation

@tokio-on-jupiter

Copy link
Copy Markdown
Contributor

Why

A reviewer on #22 asked whether the new ci/*-values.yaml fixtures were used by any test suite. They weren't: the stock values.yaml disables most templates (deployment is the only thing on by default), so the PR-workflow render/Pluto/kubeconform loop over the fixtures was the only thing exercising VPA, KEDA, ExternalSecret, TargetGroupBinding, the new env model, CronJob's batch/v1 move, PDB and the RBAC overrides. This converts that into a proper helm-unittest suite.

What

  • Moved charts/application/ci/*-values.yaml to charts/application/tests/fixtures/ (content unchanged, already anonymized) and referenced them from suites via suite-level values:.
  • Added suites under charts/application/tests/, one file per template area (deployment, configmap, cronjob, pdb, service, rbac, vpa, keda, externalsecret, targetgroupbinding, hpa, certificate), plus fixtures_test.yaml with one matchSnapshot per fixture so any output drift has to be reviewed. 52 tests, 37 snapshotted documents, all passing.
  • Fixed a bug the tests caught: deployment.terminationGracePeriodSeconds / automountServiceAccountToken rendered as explicit null by default (podSpecCommon checked hasKey instead of the value), instead of being omitted like every other optional field in this chart. Switched to the same kindIs "invalid" check already used for replicas/revisionHistoryLimit/suspend elsewhere.
  • CI: bumped the workflow's Helm to v3.17.1 (lint / dry-run install / package all still pass under it — verified locally) so the helm-unittest plugin can install; pinned the plugin to v1.0.3 since newer releases moved plugin.yaml to a schema (platformHooks) that needs Helm 3.18.10+. Added a helm unittest charts/application step and pointed the existing fixture loop at tests/fixtures/*-values.yaml.
  • Documented the suite in both README.md and charts/application/README.md (kept identical) and added a ### Unreleased changelog entry.

How to run

helm plugin list | grep -q unittest || helm plugin install https://github.com/helm-unittest/helm-unittest --version v1.0.3
helm unittest charts/application

Verified locally: helm lint, helm unittest (52/52), the fixture render/Pluto/kubeconform loop, helm install --dry-run, helm package, and re-rendering every fixture with a Helm 3.7.0 binary to confirm template compatibility is unchanged.

Co-authored-by: Claude noreply@anthropic.com

tokio-on-jupiter and others added 2 commits September 17, 2026 14:59
Adds suites under charts/application/tests/, one per template area, covering
the workload shapes PR #22 introduced (VPA, KEDA, ExternalSecret,
TargetGroupBinding, the env model, CronJob batch/v1, PDB, RBAC overrides).
Moves ci/*-values.yaml to tests/fixtures/ and wires them into the suites via
suite-level values:, plus a matchSnapshot per fixture so any output drift
must be reviewed.

Also fixes a bug the tests caught: deployment.terminationGracePeriodSeconds
and deployment.automountServiceAccountToken rendered as explicit `null` by
default because podSpecCommon checked hasKey instead of the value itself
(both keys are pre-declared null in values.yaml). Switched to the same
kindIs "invalid" check already used for replicas/revisionHistoryLimit/
suspend elsewhere in this chart.

Co-authored-by: Claude <noreply@anthropic.com>
…p at tests/fixtures

Bumps the PR workflow's Helm to v3.17.1 (lint, dry-run install and package all
still pass) so the helm-unittest plugin can be installed, pinned to v1.0.3
since newer releases need Helm 3.18.10+ for their plugin.yaml. Points the
existing render/Pluto/kubeconform loop at tests/fixtures/*-values.yaml now
that ci/ moved. Documents both in the READMEs and changelog.

Co-authored-by: Claude <noreply@anthropic.com>
@tokio-on-jupiter
tokio-on-jupiter requested a review from a team as a code owner September 17, 2026 18:59
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

@ryanmcafee Validation Successful

@tokio-on-jupiter
tokio-on-jupiter merged commit 0d6ba9d into main Sep 23, 2026
3 checks passed
@tokio-on-jupiter
tokio-on-jupiter deleted the PLATENG-1214/helm-unittest-suite branch September 23, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants