From 979023392dbfd7dca566ecabdff8a99a6eda9afe Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Wed, 2 Feb 2022 15:08:04 -0600 Subject: [PATCH] authclustertests wasn't working because... weirdness with the docker-compose file being in a different directory, I think. --- Makefile | 11 +-- internal/authclustertests/docker-compose.yml | 77 ------------------- internal/clustertests/docker-compose.yml | 8 +- .../testdata/certs/README.md | 0 .../testdata/certs/localhost.crt | 0 .../testdata/certs/localhost.csr | 0 .../testdata/certs/localhost.key | 0 .../testdata/certs/pilosa-ca.crl | 0 .../testdata/certs/pilosa-ca.crt | 0 .../testdata/certs/pilosa-ca.key | 0 .../testdata/featurebase.conf | 6 +- .../testdata/permissions.yaml | 0 12 files changed, 13 insertions(+), 89 deletions(-) delete mode 100644 internal/authclustertests/docker-compose.yml rename internal/{authclustertests => clustertests}/testdata/certs/README.md (100%) rename internal/{authclustertests => clustertests}/testdata/certs/localhost.crt (100%) rename internal/{authclustertests => clustertests}/testdata/certs/localhost.csr (100%) rename internal/{authclustertests => clustertests}/testdata/certs/localhost.key (100%) rename internal/{authclustertests => clustertests}/testdata/certs/pilosa-ca.crl (100%) rename internal/{authclustertests => clustertests}/testdata/certs/pilosa-ca.crt (100%) rename internal/{authclustertests => clustertests}/testdata/certs/pilosa-ca.key (100%) rename internal/{authclustertests => clustertests}/testdata/featurebase.conf (98%) rename internal/{authclustertests => clustertests}/testdata/permissions.yaml (100%) diff --git a/Makefile b/Makefile index 442e31764..2b65141db 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/internal/authclustertests/docker-compose.yml b/internal/authclustertests/docker-compose.yml deleted file mode 100644 index 8590fabe4..000000000 --- a/internal/authclustertests/docker-compose.yml +++ /dev/null @@ -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: diff --git a/internal/clustertests/docker-compose.yml b/internal/clustertests/docker-compose.yml index 0454035c9..7b3373f79 100644 --- a/internal/clustertests/docker-compose.yml +++ b/internal/clustertests/docker-compose.yml @@ -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: diff --git a/internal/authclustertests/testdata/certs/README.md b/internal/clustertests/testdata/certs/README.md similarity index 100% rename from internal/authclustertests/testdata/certs/README.md rename to internal/clustertests/testdata/certs/README.md diff --git a/internal/authclustertests/testdata/certs/localhost.crt b/internal/clustertests/testdata/certs/localhost.crt similarity index 100% rename from internal/authclustertests/testdata/certs/localhost.crt rename to internal/clustertests/testdata/certs/localhost.crt diff --git a/internal/authclustertests/testdata/certs/localhost.csr b/internal/clustertests/testdata/certs/localhost.csr similarity index 100% rename from internal/authclustertests/testdata/certs/localhost.csr rename to internal/clustertests/testdata/certs/localhost.csr diff --git a/internal/authclustertests/testdata/certs/localhost.key b/internal/clustertests/testdata/certs/localhost.key similarity index 100% rename from internal/authclustertests/testdata/certs/localhost.key rename to internal/clustertests/testdata/certs/localhost.key diff --git a/internal/authclustertests/testdata/certs/pilosa-ca.crl b/internal/clustertests/testdata/certs/pilosa-ca.crl similarity index 100% rename from internal/authclustertests/testdata/certs/pilosa-ca.crl rename to internal/clustertests/testdata/certs/pilosa-ca.crl diff --git a/internal/authclustertests/testdata/certs/pilosa-ca.crt b/internal/clustertests/testdata/certs/pilosa-ca.crt similarity index 100% rename from internal/authclustertests/testdata/certs/pilosa-ca.crt rename to internal/clustertests/testdata/certs/pilosa-ca.crt diff --git a/internal/authclustertests/testdata/certs/pilosa-ca.key b/internal/clustertests/testdata/certs/pilosa-ca.key similarity index 100% rename from internal/authclustertests/testdata/certs/pilosa-ca.key rename to internal/clustertests/testdata/certs/pilosa-ca.key diff --git a/internal/authclustertests/testdata/featurebase.conf b/internal/clustertests/testdata/featurebase.conf similarity index 98% rename from internal/authclustertests/testdata/featurebase.conf rename to internal/clustertests/testdata/featurebase.conf index 8661df8cf..3725ba41b 100644 --- a/internal/authclustertests/testdata/featurebase.conf +++ b/internal/clustertests/testdata/featurebase.conf @@ -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" diff --git a/internal/authclustertests/testdata/permissions.yaml b/internal/clustertests/testdata/permissions.yaml similarity index 100% rename from internal/authclustertests/testdata/permissions.yaml rename to internal/clustertests/testdata/permissions.yaml