From dcb4b102835d1c9911cfc9a47fb9bfc2084ffdbf Mon Sep 17 00:00:00 2001 From: Arie Lev <34907201+ArieLevs@users.noreply.github.com> Date: Wed, 14 Apr 2021 20:05:38 +0300 Subject: [PATCH] Add container based tests documentation (#492) * update documentation with running unit tests using container * promote bats version to 1.3.0 * Update CONTRIBUTING.md Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com> * Update CONTRIBUTING.md Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com> Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com> --- CONTRIBUTING.md | 21 ++++++++++++++++++--- test/docker/Test.dockerfile | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 431dfa8..6422262 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,8 +62,23 @@ The unit tests don't require any active Kubernetes cluster and complete very quickly. These should be used for fast feedback during development. The acceptance tests require a Kubernetes cluster with a configured `kubectl`. -### Prequisites -* [Bats](https://github.com/bats-core/bats-core) +### Test Using Docker Container + +The following are the instructions for running bats tests using a Docker container. + +#### Prerequisites + +* Docker installed +* `vault-helm` checked out locally + +#### Test + +**Note:** the following commands should be run from the `vault-helm` directory. + +First, build the Docker image for running the tests: + +```shell +docker build -f ${PWD}/test/docker/Test.dockerfile ${PWD}/test/docker/ -t vault-helm-test ```bash brew install bats-core ``` @@ -76,7 +91,7 @@ The acceptance tests require a Kubernetes cluster with a configured `kubectl`. brew install kubernetes-helm ``` -### Running The Tests +#### Test To run the unit tests: diff --git a/test/docker/Test.dockerfile b/test/docker/Test.dockerfile index 4b1c375..98afeac 100644 --- a/test/docker/Test.dockerfile +++ b/test/docker/Test.dockerfile @@ -9,7 +9,7 @@ FROM docker.mirror.hashicorp.services/alpine:latest WORKDIR /root -ENV BATS_VERSION "1.1.0" +ENV BATS_VERSION "1.3.0" ENV TERRAFORM_VERSION "0.12.10" # base packages