Skip to content

Commit

Permalink
Add container based tests documentation (hashicorp#492)
Browse files Browse the repository at this point in the history
* update documentation with running unit tests using container

* promote bats version to 1.3.0

* Update CONTRIBUTING.md

Co-authored-by: Jason O'Donnell <[email protected]>

* Update CONTRIBUTING.md

Co-authored-by: Jason O'Donnell <[email protected]>

Co-authored-by: Jason O'Donnell <[email protected]>
  • Loading branch information
ArieLevs and jasonodonnell authored Apr 14, 2021
1 parent 2733859 commit dcb4b10
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 18 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion test/docker/Test.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dcb4b10

Please sign in to comment.