From 77c9611784fe698f3f2644a680ef75c384d8ba03 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Thu, 21 Oct 2021 09:57:38 +0300 Subject: [PATCH] Improve the test suite docs Signed-off-by: Stefan Prodan --- CONTRIBUTING.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4f080131..b63794b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,27 +63,42 @@ To get started with developing controllers, you might want to review walks you through writing a short and concise controller that watches out for source changes. -### How to run the test suite +## How to run the test suite Prerequisites: * go >= 1.16 -* kubectl >= 1.18 -* kustomize >= 3.1 +* kubectl >= 1.19 +* kustomize >= 4.0 -You can run the unit tests by simply doing +Install the [controller-runtime/envtest](https://github.com/kubernetes-sigs/controller-runtime/tree/master/tools/setup-envtest) binaries with: + +```bash +make install-envtest +``` + +Then you can run the unit tests with: ```bash make test ``` -The e2e test suite uses [kind](https://kind.sigs.k8s.io/) for running kubernetes cluster inside docker containers. You can run the e2e tests by simply doing +After [installing Kubernetes kind](https://kind.sigs.k8s.io/docs/user/quick-start#installation) on your machine, +create a cluster for testing with: ```bash make setup-kind +``` + +Then you can run the end-to-end tests with: + +```bash make e2e +``` -# When done +Teardown the e2e environment with: + +```bash make cleanup-kind ```