An open API service indexing awesome lists of open source software.

https://github.com/seanson/terratest-helm-tester

A prebuilt container for running custom Terratest against Helm charts
https://github.com/seanson/terratest-helm-tester

Last synced: 3 months ago
JSON representation

A prebuilt container for running custom Terratest against Helm charts

Awesome Lists containing this project

README

        

# terratest-helm-tester

[![Docker Build](https://img.shields.io/docker/cloud/automated/seanson/terratest-helm-tester?style=for-the-badge)](https://hub.docker.com/r/seanson/terratest-helm-tester)
[![Docker Build](https://img.shields.io/docker/cloud/build/seanson/terratest-helm-tester?style=for-the-badge)](https://hub.docker.com/r/seanson/terratest-helm-tester)
[![CircleCI Build](https://img.shields.io/circleci/build/github/seanson/terratest-helm-tester/master?style=for-the-badge)](https://circleci.com/gh/seanson/terratest-helm-tester)

A prebuilt Docker container for running Helm chart spec tests.

## Usage

Create a directory in your project folder for your tests and write a test as per the [example helm test](./test/helm_test.go).

`docker run -v ${PWD}/tests: -v ${PWD}:/app/test seanson/terratest-helm-tester`

This will run the tests found in the `./tests/...` path with the Terratest log wrapper and generate text and XML results.

## CI Support

### CircleCI

CircleCI does not let you copy images in and out of your container in Docker mode so machine mode is required.

See [.cicleci/config.yml](.circleci/config.yml) for details on running CI and copying tests out afterwards.

### Running as a non-root

In some CI systems the build is run by a non-root user. The environment variable `USER_ID` can be passed to the container and it will change ownership of the result files.

`docker run -e USER_ID="$(id -u)" -v ${PWD}/tests: -v ${PWD}:/app/test seanson/terratest-helm-tester`

## TODO

- [x] Sort out better mounting path for tests
- [x] Add wrapper and log parser for generating test outputs
- [x] Show real CI usage
- [ ] Document testing tags