authclustertests wasn't working because...

weirdness with the docker-compose file being in a different directory,
I think.
This commit is contained in:
Matthew Jaffee 2022-02-02 15:08:04 -06:00
parent 61783e5827
commit 979023392d
12 changed files with 13 additions and 89 deletions

View file

@ -159,12 +159,13 @@ clustertests: vendor
$(DOCKER_COMPOSE) -f internal/clustertests/docker-compose.yml down
# Run the cluster tests with authentication enabled
AUTH_ARGS="-c /go/src/github.com/molecula/featurebase/internal/authclustertests/testdata/featurebase.conf"
authclustertests: vendor
$(DOCKER_COMPOSE) -f internal/authclustertests/docker-compose.yml down
$(DOCKER_COMPOSE) -f internal/authclustertests/docker-compose.yml build
$(DOCKER_COMPOSE) -f internal/authclustertests/docker-compose.yml up -d pilosa1 pilosa2 pilosa3
PROJECT=$(PROJECT) $(DOCKER_COMPOSE) -f internal/authclustertests/docker-compose.yml run client1
$(DOCKER_COMPOSE) -f internal/authclustertests/docker-compose.yml down
CLUSTERTESTS_FB_ARGS=$(AUTH_ARGS) $(DOCKER_COMPOSE) -f internal/clustertests/docker-compose.yml down
CLUSTERTESTS_FB_ARGS=$(AUTH_ARGS) $(DOCKER_COMPOSE) -f internal/clustertests/docker-compose.yml build
CLUSTERTESTS_FB_ARGS=$(AUTH_ARGS) $(DOCKER_COMPOSE) -f internal/clustertests/docker-compose.yml up -d pilosa1 pilosa2 pilosa3
PROJECT=$(PROJECT) ENABLE_AUTH=1 $(DOCKER_COMPOSE) -f internal/clustertests/docker-compose.yml run client1
CLUSTERTESTS_FB_ARGS=$(AUTH_ARGS) $(DOCKER_COMPOSE) -f internal/clustertests/docker-compose.yml down
# Install Pilosa
install:

View file

@ -1,77 +0,0 @@
version: '2'
services:
pilosa1:
build:
context: ../..
dockerfile: Dockerfile-clustertests
image: ptest
environment:
- PILOSA_NAME=pilosa1
- PILOSA_ETCD_DIR=/root/.etcd
- PILOSA_ETCD_LISTEN_CLIENT_ADDRESS=http://0.0.0.0:10201
- PILOSA_ETCD_ADVERTISE_CLIENT_ADDRESS=http://pilosa1:10201
- PILOSA_ETCD_LISTEN_PEER_ADDRESS=http://0.0.0.0:10301
- PILOSA_ETCD_ADVERTISE_PEER_ADDRESS=http://pilosa1:10301
- PILOSA_ETCD_INITIAL_CLUSTER=pilosa1=http://pilosa1:10301,pilosa2=http://pilosa2:10301,pilosa3=http://pilosa3:10301
- PILOSA_CLUSTER_REPLICAS=3
networks:
- pilosanet
command:
- "/featurebase server --bind pilosa1:10101 -c /go/src/github.com/molecula/featurebase/internal/authclustertests/testdata/featurebase.conf"
pilosa2:
build:
context: ../..
dockerfile: Dockerfile-clustertests
image: ptest
environment:
- PILOSA_NAME=pilosa2
- PILOSA_ETCD_DIR=/root/.etcd
- PILOSA_ETCD_LISTEN_CLIENT_ADDRESS=http://0.0.0.0:10201
- PILOSA_ETCD_ADVERTISE_CLIENT_ADDRESS=http://pilosa2:10201
- PILOSA_ETCD_LISTEN_PEER_ADDRESS=http://0.0.0.0:10301
- PILOSA_ETCD_ADVERTISE_PEER_ADDRESS=http://pilosa2:10301
- PILOSA_ETCD_INITIAL_CLUSTER=pilosa1=http://pilosa1:10301,pilosa2=http://pilosa2:10301,pilosa3=http://pilosa3:10301
- PILOSA_CLUSTER_REPLICAS=3
networks:
- pilosanet
command:
- "/featurebase server --bind pilosa2:10101 -c /go/src/github.com/molecula/featurebase/internal/authclustertests/testdata/featurebase.conf"
pilosa3:
build:
context: ../..
dockerfile: Dockerfile-clustertests
image: ptest
environment:
- PILOSA_NAME=pilosa3
- PILOSA_ETCD_DIR=/root/.etcd
- PILOSA_ETCD_LISTEN_CLIENT_ADDRESS=http://0.0.0.0:10201
- PILOSA_ETCD_ADVERTISE_CLIENT_ADDRESS=http://pilosa3:10201
- PILOSA_ETCD_LISTEN_PEER_ADDRESS=http://0.0.0.0:10301
- PILOSA_ETCD_ADVERTISE_PEER_ADDRESS=http://pilosa3:10301
- PILOSA_ETCD_INITIAL_CLUSTER=pilosa1=http://pilosa1:10301,pilosa2=http://pilosa2:10301,pilosa3=http://pilosa3:10301
- PILOSA_CLUSTER_REPLICAS=3
networks:
- pilosanet
command:
- "/featurebase server --bind pilosa3:10101 -c /go/src/github.com/molecula/featurebase/internal/authclustertests/testdata/featurebase.conf"
client1:
build:
context: .
dockerfile: ../clustertests/Dockerfile
depends_on:
- "pilosa1"
- "pilosa2"
- "pilosa3"
environment:
- ENABLE_PILOSA_CLUSTER_TESTS=1
- GO111MODULE=on
- PROJECT=authclustertests
- ENABLE_AUTH=1
networks:
- pilosanet
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command:
- "cd /go/src/github.com/molecula/featurebase/ && go test -mod=vendor -v -count=1 github.com/molecula/featurebase/v3/internal/clustertests"
networks:
pilosanet:

View file

@ -17,7 +17,7 @@ services:
networks:
- pilosanet
command:
- "/featurebase server --bind pilosa1:10101"
- "/featurebase server --bind pilosa1:10101 ${CLUSTERTESTS_FB_ARGS}"
pilosa2:
build:
context: ../..
@ -35,7 +35,7 @@ services:
networks:
- pilosanet
command:
- "/featurebase server --bind pilosa2:10101"
- "/featurebase server --bind pilosa2:10101 ${CLUSTERTESTS_FB_ARGS}"
pilosa3:
build:
context: ../..
@ -53,7 +53,7 @@ services:
networks:
- pilosanet
command:
- "/featurebase server --bind pilosa3:10101"
- "/featurebase server --bind pilosa3:10101 ${CLUSTERTESTS_FB_ARGS}"
client1:
build:
context: .
@ -65,7 +65,7 @@ services:
- ENABLE_PILOSA_CLUSTER_TESTS=1
- GO111MODULE=on
- PROJECT=${PROJECT}
- ENABLE_AUTH=0
- ENABLE_AUTH=${ENABLE_AUTH}
networks:
- pilosanet
volumes:

View file

@ -298,8 +298,8 @@
# Suffix should contain .crt or .pem
[tls]
certificate = "/go/src/github.com/molecula/featurebase/internal/authclustertests/testdata/certs/localhost.crt"
key = "/go/src/github.com/molecula/featurebase/internal/authclustertests/testdata/certs/localhost.key"
certificate = "/go/src/github.com/molecula/featurebase/internal/clustertests/testdata/certs/localhost.crt"
key = "/go/src/github.com/molecula/featurebase/internal/clustertests/testdata/certs/localhost.key"
# ==============================================================================
# Tracing Section
@ -378,6 +378,6 @@
logout-url = "https://login.microsoftonline.com/common/oauth2/v2.0/logout"
scopes = ["https://graph.microsoft.com/.default", "offline_access"]
secret-key = "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF"
permissions = "/go/src/github.com/molecula/featurebase/internal/authclustertests/testdata/permissions.yaml"
permissions = "/go/src/github.com/molecula/featurebase/internal/clustertestsx/testdata/permissions.yaml"
query-log-path = "query-log-test.log"
redirect-base-url = "https://localhost:10101"