Unit Tests

Abstract

Unit tests for helm charts.

Unit Tests#

Usage#

  1. Install the [helm unittest] plugin.

    install#
    helm plugin install https://github.com/helm-unittest/helm-unittest
    
  2. Run the tests.

    test#
    helm unittest -f 'tests/*.yaml' .
    

Test Suites#

This provides the following suites.

StatefulSet Suite#

suite

StatefulSet Test Suite


Tests to validate the deployment of the described StatefulSet.

suite: test for deployment
release:
  name: argo-cd
templates:
- 'charts/argo-cd/templates/argocd-server/deployment.yaml'
- 'charts/argo-cd/templates/argocd-configs/argocd-cm.yaml'
- 'charts/argo-cd/templates/argocd-configs/argocd-cmd-params-cm.yaml'
values:
- ../values.yaml
tests

Deployment Tests


Tests for Deployment Template

tests:
- it: should be a Deployment
  asserts:
  - isKind:
      of: Deployment
  - equal:
      path: metadata.name
      value: argo-cd-argocd-server
  documentIndex: 0
  template: 'charts/argo-cd/templates/argocd-server/deployment.yaml'