Skip to content

Latest commit

 

History

History
46 lines (28 loc) · 2.19 KB

TESTING.md

File metadata and controls

46 lines (28 loc) · 2.19 KB

Testing Guide

This Helm Chart requires extensive testing to ensure expected behavior are met for everyone.

Requirements

All tests are run using Docker; no further dependencies are required.

Test Driven Development

"TDD" practise (Test Driven Development) should be followed when adding a new feature or fixing a bug.

It means that you are expected to:

  1. Start by adding a test describing the expected behaviour, that should fails (either because the bug exists in initial state, or because the new feature had not been implemented),
  2. Then, change the code according to your intent (fixing a bug, adding a feature or refactoring),
  3. Finally, the test suite (including the new test you added earlier) must pass.

Test Kinds

Please note that this chart has the following kind of tests (see respective sections below for description):

Unit Testing

Unit test suite is run by invoking the make target test: make test. It is run by default on the CI.

Static Testing

The static test suite has the following properties:

  • Static tests are about linting the YAML files, shell scripts and Helm elements. It is also a set of verifications around versions, names, etc.
  • Static tests are fast to run, hence it must be run for each commit and pull requests and are considered blocking when failing.
  • Static test suite is run by invoking the make target lint: make lint. It is run by default on the CI.

The static test suite is implemented with the tool ct (Chart Testing):

  • The Docker image of ct is used to ensure all sub-dependencies (helm, kubectl, yamale, etc.) are met for an easier experience for contributor.
  • All configuration of ct and linters are stored in the directory lint/. In particular, the file lint/ct.yaml contains the ct configuration.
  • Version Increment Check is done against the against the original repository, with the branch master. This repository is added as an additional git remote named traefik by the make target lint. If you wish to temporarly change this behavior, please edit the files Makefile and lint/ct.yaml.