forked from scylladb/gocql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
integration.sh
executable file
·47 lines (37 loc) · 1.06 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
#!/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
echo "==> Waiting for CQL port"
for s in $(docker-compose ps --services); do
until v=$(${exec} ${s} cqlsh -e "DESCRIBE SCHEMA"); do
echo ${v}
docker-compose logs --tail 10 ${s}
sleep 5
done
done
echo "==> Waiting for CQL port done"
}
function scylla_down() {
echo "==> Stopping Scylla"
docker-compose down
}
function scylla_restart() {
scylla_down
scylla_up
}
scylla_restart
readonly clusterSize=1
readonly scylla_liveset="192.168.100.11"
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}"
echo "==> Running $* tests with args: ${args}"
go test -timeout=5m -race -tags="$*" ${args} ./...