perses / helm-charts

Perses helm chart
Apache License 2.0
12 stars 7 forks source link

Add Helm Chart Tests using bats-detik framework #39

Open ibakshay opened 5 days ago

ibakshay commented 5 days ago

Proposal

Overview

Add comprehensive Helm Chart Test capabilities to Perses helm charts using the bats-detik testing framework.

Motivation

Currently, Perses helm chart lack automated testing. Adding helm chart tests will improve reliability and catch potential issues earlier.

Proposed Solution

Implement helm chart tests using bats-detik framework, which offers several advantages:

  1. Kubernetes-native testing capabilities with built-in assertions
  2. Simple, human readible syntax for writing tests
  3. Declarative test definitions using YAML
  4. Built-in retry mechanisms for handling eventual consistency
  5. Strong support for validating Kubernetes resources

CI Integration

Will update GitHub Actions workflow to include helm testing:

name: "Helm lint and tests"
jobs:
  helm-lint-test:
    runs-on: [ default ]
    steps:
      - name: Create kind cluster
        uses: helm/kind-action@v1.10.0

      - name: Run chart integration tests
        run: ct install --config .github/configs/helm-test.yaml

Prior Art

We're already successfully using bats-detik for the helm charts in our kubernetes-based platform. Reference implementation can be found here: https://cloudoperators.github.io/greenhouse/docs/user-guides/plugin/plugin-tests/

If this proposal is accepted then I will create a Pull Request πŸ˜€ CC: @nicolastakashi @Nexucis

nicolastakashi commented 3 days ago

I really love that idea, we're using it in the OTel helm chart as well πŸ‘πŸ½