Skip to content

Helm Chart Testing #18

Description

@lukidoescode

Motivation

The Helm chart is the primary deployment mechanism. Without automated chart testing, template regressions (missing values, broken YAML, invalid resource specs) are only caught at E2E time or, worse, in production.

Definition of Done

  • helm template renders without errors for the default values and for common value combinations (metrics enabled/disabled, PDB enabled/disabled, ServiceMonitor enabled/disabled).
  • helm lint passes. Ticket CI Pipeline Foundation #21 incorporates this into the CI pipeline; this ticket adds deeper testing beyond basic linting.
  • ct lint (chart-testing) validates the chart against chart-testing rules (version bump, maintainer list, etc.).
  • ct install runs a full install/upgrade/delete cycle against a k3d cluster as part of E2E tests.
  • helm test hook(s) are defined in the chart:
    • A test pod that verifies the operator is running and healthy (/healthz returns 200).
  • Unit tests for Helm templates (using helm-unittest or similar) cover critical template logic (conditional ServiceMonitor, PDB creation, securityContext).
  • Documentation: Document how to run chart tests locally in the Development Guide chapter.

Technical Details

  • ct (chart-testing) is the standard Helm chart CI tool. Install via helm/chart-testing-action in GitHub Actions.
  • helm-unittest: a Helm plugin for unit-testing templates. Tests are YAML files in charts/lldap-operator/tests/.
  • The helm test hook is a Job with helm.sh/hook: test annotation that runs curl or wget against the operator's healthz endpoint.
  • Chart testing in CI should run BEFORE E2E tests (Ticket End-to-End Test Suite #20) — a broken chart means E2E tests can't even start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions