Kubernetes functional tests suite for helm charts
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples feat: adding more examples Feb 16, 2019
.gitignore feat: adding examples and common useful functions Jan 18, 2019
LICENSE
README.md feat: adding more examples Feb 16, 2019
bootstrap_k8s.sh feat: do not install k8s if already bootstraped Jan 16, 2019
clean_k8s.sh
env.bash feat: supporting centos Jan 28, 2019
helm.sh feat: first release Jul 10, 2018
helm_lint.bats feat: first release Jul 10, 2018
prerequisites.sh feat: supporting centos Jan 28, 2019
travis-exec.go fix: ensure travis config file is idempotent Jan 28, 2019

README.md

K8s End User Funtional Testing (k8s-euft)

We've made this repository to be able to replicate a kubernetes cluster and run functional tests as simply as possible with the less dependencies as possible.

You know that it can be hard to test and this is can be critic for some services like stateful applications. That's why this tooling exist, to perform automatic tests, you can use:

We're using Kubeadm DIND Cluster to quickly deploy a Kubernetes testing cluster.

Then you can use your favorite framework/language to perform your tests.

Install

Simply create a tests folder inside your repository and add this repository as a submodule (or simply clone it if you don't want to use submodules):

mkdir tests && cd tests
git submodule add https://github.com/MySocialApp/k8s-euft.git
cat k8s-euft/examples/.gitignore >> ../.gitignore

Usage with Travis

First, of all, setup a travis-ci account, link it to your repository and create .travis.yml file in the root directory of your repository.

You can use the travis example file:

cp k8s-euft/examples/.travis.yml ../.travis.yml

The env section describes the environment variables for:

  • K8S_VERSION: the Kubernetes version you want to deploy
  • GIT_REV: the git commit/tag/branch to pin on Kubeadm DIND Cluster
  • HELM_VERSION: the helm version you want to deploy
  • NUM_NODES: the number of non master nodes you need in your cluster

The install section will perform helm linting checks, Kubernetes install and deploy helm on this newly create Kubernetes cluster.

Finally, in the script section, set all your tests files or folders you want to apply.

Usage with Vagrant

If you want to also run those tests locally, a basic go script helps to read travis config and run it. So you'll need a travis.yaml file as well that will be deployed inside your VM.

You can use the Vagrant example config:

cp k8s-euft/examples/Vagrantfile .

To perform tests, simply run Vagrant up.

Make basic tests

In the examples folder, you'll find a simple use case to start. To initialize it, simply copy those files:

cp k8s-euft/examples/run_tests.sh .
cp -Rf k8s-euft/examples/play .

Projects using k8s-euft