Tests

Note

If you want to run the tests locally then you need to create a docker volume with the htpasswd and certificate config files. To create this volume run the command:

docker run --rm \
  -v $PWD/test/test_config_files:/source \
  -v mship_test_config_files:/dest \
  ubuntu:xenial cp -r /source/. /dest

Run the tests locally

(Remember to clean your Mothership environment first by running ./mothership serve --clean)

$ go test ./... -tags=all -p=1

The -tags option can be blank, all or integration, based on which tests you want to run.

Run the tests with Docker

Run the tests using the Makefile:

$ make tests             # Run all tests
$ make unit-tests        # Run only unit tests
$ make integration-tests # Run only integration tests