forked from apache/cassandra-gocql-driver
-
Notifications
You must be signed in to change notification settings - Fork 59
/
integration.sh
executable file
·54 lines (42 loc) · 1.47 KB
/
integration.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
#
# Copyright (C) 2017 ScyllaDB
#
readonly SCYLLA_IMAGE=${SCYLLA_IMAGE}
set -eu -o pipefail
function scylla_up() {
local -r exec="docker compose exec -T"
echo "==> Running Scylla ${SCYLLA_IMAGE}"
docker pull ${SCYLLA_IMAGE}
docker compose up -d --wait || ( docker compose ps --format json | jq -M 'select(.Health == "unhealthy") | .Service' | xargs docker compose logs; exit 1 )
}
function scylla_down() {
echo "==> Stopping Scylla"
docker compose down
}
function scylla_restart() {
scylla_down
scylla_up
}
scylla_restart
sudo chmod 0777 /tmp/scylla/cql.m
readonly clusterSize=1
readonly multiNodeClusterSize=3
readonly scylla_liveset="192.168.100.11"
readonly scylla_tablet_liveset="192.168.100.12"
readonly cversion="3.11.4"
readonly proto=4
readonly args="-gocql.timeout=60s -proto=${proto} -rf=${clusterSize} -clusterSize=${clusterSize} -autowait=2000ms -compressor=snappy -gocql.cversion=${cversion} -cluster=${scylla_liveset}"
readonly tabletArgs="-gocql.timeout=60s -proto=${proto} -rf=1 -clusterSize=${multiNodeClusterSize} -autowait=2000ms -compressor=snappy -gocql.cversion=${cversion} -multiCluster=${scylla_tablet_liveset}"
if [[ "$*" == *"tablet"* ]];
then
echo "==> Running tablet tests with args: ${tabletArgs}"
go test -timeout=5m -race -tags="tablet" ${tabletArgs} ./...
fi
TAGS=$*
TAGS=${TAGS//"tablet"/}
if [ ! -z "$TAGS" ];
then
echo "==> Running ${TAGS} tests with args: ${args}"
go test -timeout=5m -race -tags="$TAGS" ${args} ./...
fi