mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 00:55:55 +00:00
- For server side, used an instrumented binary with a test that wraps around the main entrypoint for featurebase - Every time, the binary is called, a new coverage file is generated. - For the client side, used the standard -coverprofile flag for go test to generate code coverage - For backup test that's expected to fail, needed to call Run call in backup.go directly. The code coverage is not written to disk for an instrumented binary if there is an error.
88 lines
3.4 KiB
YAML
88 lines
3.4 KiB
YAML
version: '2'
|
|
services:
|
|
pilosa1:
|
|
build:
|
|
context: ../..
|
|
dockerfile: Dockerfile-clustertests
|
|
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
|
|
volumes:
|
|
- ./results:/results
|
|
command:
|
|
- "cd /go/src/github.com/molecula/featurebase/cmd/featurebase && /featurebase -test.run=TestRunMain -test.coverprofile=/results/coverage-server1.out server --bind pilosa1:10101 ${CLUSTERTESTS_FB_ARGS}"
|
|
pilosa2:
|
|
build:
|
|
context: ../..
|
|
dockerfile: Dockerfile-clustertests
|
|
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
|
|
volumes:
|
|
- ./results:/results
|
|
command:
|
|
- "cd /go/src/github.com/molecula/featurebase/cmd/featurebase && /featurebase -test.run=TestRunMain -test.coverprofile=/results/coverage-server2.out server --bind pilosa2:10101 ${CLUSTERTESTS_FB_ARGS}"
|
|
pilosa3:
|
|
build:
|
|
context: ../..
|
|
dockerfile: Dockerfile-clustertests
|
|
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
|
|
volumes:
|
|
- ./results:/results
|
|
command:
|
|
- "cd /go/src/github.com/molecula/featurebase/cmd/featurebase && /featurebase -test.run=TestRunMain -test.coverprofile=/results/coverage-server3.out server --bind pilosa3:10101 ${CLUSTERTESTS_FB_ARGS}"
|
|
client1:
|
|
build:
|
|
context: ../..
|
|
dockerfile: Dockerfile-clustertests-client
|
|
depends_on:
|
|
- "pilosa1"
|
|
- "pilosa2"
|
|
- "pilosa3"
|
|
- "fakeidp"
|
|
environment:
|
|
- ENABLE_PILOSA_CLUSTER_TESTS=1
|
|
- GO111MODULE=on
|
|
- PROJECT=${PROJECT}
|
|
- ENABLE_AUTH=${ENABLE_AUTH}
|
|
networks:
|
|
- pilosanet
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- ./results:/results
|
|
command:
|
|
- "cd /go/src/github.com/molecula/featurebase/ && go test -mod=vendor -v -count=1 -covermode=atomic -coverprofile=/results/coverage-clustertests.out -coverpkg=./... -json github.com/molecula/featurebase/v3/internal/clustertests | tee /results/report-clustertests.out"
|
|
fakeidp:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile-fakeIDP
|
|
networks:
|
|
- pilosanet
|
|
networks:
|
|
pilosanet:
|