|
1 | | -# Deis integration testing |
| 1 | +# Deis Tests |
2 | 2 |
|
3 | | -This directory contains a Go package which will run integration tests on an |
4 | | -existing Deis cluster. |
| 3 | +This directory contains a [Go](http://golang.org/) package with integration |
| 4 | +tests for the [Deis](http://deis.io/) open source PaaS. |
5 | 5 |
|
6 | | -Repo should be properly checked out into your GOPATH |
7 | | -go get github.com/deis/deis |
| 6 | +[](https://godoc.org/github.com/deis/deis/tests) |
8 | 7 |
|
9 | | -To run all tests: |
| 8 | +**NOTE**: These integration tests are targeted for use in Deis' |
| 9 | +[continuous integration system](http://ci.deis.io/). The tests currently assume |
| 10 | +they are targeting a freshly provisioned Deis cluster. **Don't** run the |
| 11 | +integration tests on a Deis installation with existing users; the tests will |
| 12 | +fail and could overwrite data. |
| 13 | + |
| 14 | +## Test Setup |
| 15 | + |
| 16 | +Check out [Deis' source code](https://github.com/deis/deis) into the `$GOPATH`: |
| 17 | + |
| 18 | +```console |
| 19 | +$ go get -u -v github.com/deis/deis |
| 20 | +$ cd $GOPATH/src/github.com/deis/deis/tests |
| 21 | +``` |
| 22 | + |
| 23 | +Provision a Deis cluster as usual, and ensure that a matching `deis` |
| 24 | +command-line client is available in your `$PATH`. |
| 25 | + |
| 26 | +Create two SSH keys: |
| 27 | + |
| 28 | +```console |
| 29 | +$ ssh-keygen -q -t rsa -f ~/.ssh/deis -N '' -C deis |
| 30 | +$ ssh-keygen -q -t rsa -f ~/.ssh/deiskey -N '' -C deiskey |
| 31 | +``` |
| 32 | + |
| 33 | +The first key `deis` is used for authentication against Deis by the `test` user |
| 34 | +who runs the integration tests. The second `deiskey` is used only for testing |
| 35 | +`deis keys:add`, `deis keys:list`, and related commands. |
| 36 | + |
| 37 | +## Test Execution |
| 38 | + |
| 39 | +Run all the integration tests: |
10 | 40 |
|
11 | 41 | ```console |
12 | | -$ go test -v -tags integration -timeout 50m ./... |
| 42 | +$ make test-full |
13 | 43 | ``` |
14 | 44 |
|
15 | | -The test environment uses several environment variables, which can be set to customize the run: |
16 | | -* `DEIS_TEST_AUTH_KEY` - SSH key used to register with the Deis controller -- will be generated if it doesn't exist (default: `~/.ssh/deis`) |
17 | | -* `DEIS_TEST_KEY` - SSH key used to login to the controller machine (default: `~/.vagrant.d/insecure_private_key`) |
18 | | -* `DEIS_TEST_HOSTNAME` - hostname which resolves to the controller host (default: `local.deisapp.com`) |
19 | | -* `DEIS_TEST_HOSTS` - comma-separated list of IPs for nodes in the cluster -- should be internal IPs for cloud providers (default: `172.17.8.100`) |
20 | | -* `DEIS_TEST_APP` - name of the Deis example app to use, which is cloned from GitHub (default: `example-ruby-sinatra`) |
| 45 | +Or run just the [smoke test](http://www.catb.org/jargon/html/S/smoke-test.html): |
| 46 | + |
| 47 | +```console |
| 48 | +$ make test-smoke |
| 49 | +``` |
| 50 | + |
| 51 | +## Customizing Test Runs |
| 52 | + |
| 53 | +These environment variables can be set to customize the test run: |
| 54 | +* `DEIS_TEST_AUTH_KEY` - SSH key used to register with the Deis controller |
| 55 | + (default: `~/.ssh/deis`) |
| 56 | +* `DEIS_TEST_SSH_KEY` - SSH key used to login to the controller machine |
| 57 | + (default: `~/.vagrant.d/insecure_private_key`) |
| 58 | +* `DEIS_TEST_DOMAIN` - the domain to use for testing |
| 59 | + (default: `local.deisapp.com`) |
| 60 | +* `DEIS_TEST_HOSTS` - comma-separated list of IPs for nodes in the cluster, |
| 61 | + should be internal IPs for cloud providers (default: `172.17.8.100`) |
| 62 | +* `DEIS_TEST_APP` - name of the |
| 63 | + [Deis example app](https://github.com/deis?query=example-) to use, which is |
| 64 | + cloned from GitHub (default: random) |
0 commit comments