Skip to content

Commit 1950a27

Browse files
committed
docs(tests): update README.md with integration test setup
1 parent ad46d77 commit 1950a27

10 files changed

Lines changed: 72 additions & 19 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ test-components:
160160
)
161161

162162
test-integration:
163-
$(MAKE) -C tests/ test
163+
$(MAKE) -C tests/ test-full
164164

165165
test-smoke:
166166
$(MAKE) -C tests/ test-smoke

tests/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
test:
2-
GOPATH=$(CURDIR)/_vendor:$(GOPATH) \
3-
go test -tags integration -v -run TestSmoke
1+
test: test-smoke
42

53
test-smoke:
64
GOPATH=$(CURDIR)/_vendor:$(GOPATH) \

tests/README.md

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,64 @@
1-
# Deis integration testing
1+
# Deis Tests
22

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.
55

6-
Repo should be properly checked out into your GOPATH
7-
go get github.com/deis/deis
6+
[![GoDoc](https://godoc.org/github.com/deis/deis/tests?status.svg)](https://godoc.org/github.com/deis/deis/tests)
87

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:
1040

1141
```console
12-
$ go test -v -tags integration -timeout 50m ./...
42+
$ make test-full
1343
```
1444

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)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.1
1+
1.1.2

tests/dockercliutils/dockercliutils.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Package dockercliutils provides helper functions for testing with Docker.
2+
13
package dockercliutils
24

35
import (

tests/etcdutils/etcdutils.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Package etcdutils helps test interactions with etcd.
2+
13
package etcdutils
24

35
import (

tests/integration-utils/itutils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Package itutils provides utility functions and configuration for integration
2+
// testing with the Deis open source PaaS.
3+
14
package itutils
25

36
import (

tests/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// Package github.com/deis/deis/tests runs Deis integration tests.
1+
// Package tests contains integration tests for the Deis open source PaaS.
22
package tests

tests/mockserviceutils/mockserviceutils.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Package mockserviceutils provides mock objects and setup for Deis tests.
2+
13
package mockserviceutils
24

35
import (

tests/utils/utils.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Package utils contains commonly useful functions from Deis testing.
2+
13
package utils
24

35
import (

0 commit comments

Comments
 (0)