From 58b546a5be989f668e4fe6f02b4179debeccb0d8 Mon Sep 17 00:00:00 2001 From: Stephan Renatus Date: Tue, 20 Nov 2018 10:44:52 +0100 Subject: [PATCH] dev-integration-test: add etcd notes Signed-off-by: Stephan Renatus --- Documentation/dev-integration-tests.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/dev-integration-tests.md b/Documentation/dev-integration-tests.md index 7e8e6683..c9c84d2d 100644 --- a/Documentation/dev-integration-tests.md +++ b/Documentation/dev-integration-tests.md @@ -41,6 +41,26 @@ To run the database integration tests: - clean up the postgres container: `docker rm -f dex-postgres` +## Etcd + +These tests can also be executed using docker: + +- start the container (where `NODE1` is set to the host IP address): + + ``` + $ export NODE1=0.0.0.0 + $ docker run --name dex-etcd -p 2379:2379 -p 2380:2380 gcr.io/etcd-development/etcd:v3.3.10 \ + /usr/local/bin/etcd --name node1 \ + --initial-advertise-peer-urls http://${NODE1}:2380 --listen-peer-urls http://${NODE1}:2380 \ + --advertise-client-urls http://${NODE1}:2379 --listen-client-urls http://${NODE1}:2379 \ + --initial-cluster node1=http://${NODE1}:2380 + ``` + +- run the tests, passing the correct endpoint for this etcd instance in `DEX_ETCD_ENDPOINTS`: + + `DEX_ETCD_ENDPOINTS=http://localhost:2379 go test -v ./storage/etcd` +- clean up the etcd container: `docker rm -f dex-etcd` + ## LDAP The LDAP integration tests require [OpenLDAP][openldap] installed on the host machine. To run them, use `go test`: