Skip to content

Commit 88421dc

Browse files
committed
Run a cluster for testing on TravisCI
Bump ArangoDB to 3.3.0 Also use bash on TravisCI
1 parent 61c1416 commit 88421dc

File tree

2 files changed

+52
-7
lines changed

2 files changed

+52
-7
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ python:
66
- 3.5
77
- 3.6
88
before_install:
9-
- sh scripts/setup_arangodb.sh
9+
- bash scripts/setup_arangodb.sh
1010
install:
1111
- pip install coverage
1212
- pip install pytest

scripts/setup_arangodb.sh

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,50 @@ ARANGODB_DIR="$DIR/$NAME"
2222
ARANGOD="${ARANGODB_DIR}/bin/arangod_x86_64"
2323

2424
# create database directory
25-
mkdir ${TMP_DIR}
25+
mkdir -p ${TMP_DIR}/agency
26+
mkdir -p ${TMP_DIR}/primary
27+
mkdir -p ${TMP_DIR}/coordinator
28+
29+
echo "Starting ArangoDB Coordinator '${ARANGOD}'"
2630

27-
echo "Starting ArangoDB '${ARANGOD}'"
2831

2932
${ARANGOD} \
30-
--database.directory ${TMP_DIR} \
33+
--database.directory ${TMP_DIR}/agency \
34+
--configuration none \
35+
--server.endpoint tcp://127.0.0.1:8531 \
36+
--javascript.app-path ${ARANGODB_DIR}/js/apps \
37+
--javascript.startup-directory ${ARANGODB_DIR}/js \
38+
--server.jwt-secret=secret_password \
39+
--database.maximal-journal-size 1048576 \
40+
--agency.my-address=tcp://127.0.0.1:8531 \
41+
--agency.endpoint=tcp://127.0.0.1:8531 \
42+
--agency.activate=true \
43+
--agency.size=1 \
44+
--agency.supervision=true &
45+
46+
${ARANGOD} \
47+
--database.directory ${TMP_DIR}/primary \
48+
--configuration none \
49+
--server.endpoint tcp://127.0.0.1:8530 \
50+
--javascript.app-path ${ARANGODB_DIR}/js/apps \
51+
--javascript.startup-directory ${ARANGODB_DIR}/js \
52+
--server.jwt-secret=secret_password \
53+
--database.maximal-journal-size 1048576 \
54+
--agency.endpoint=tcp://127.0.0.1:8531 \
55+
--cluster.my-role=PRIMARY \
56+
--cluster.my-address=tcp://127.0.0.1:8530 &
57+
58+
${ARANGOD} \
59+
--database.directory ${TMP_DIR}/coordinator \
3160
--configuration none \
3261
--server.endpoint tcp://127.0.0.1:8529 \
3362
--javascript.app-path ${ARANGODB_DIR}/js/apps \
3463
--javascript.startup-directory ${ARANGODB_DIR}/js \
35-
--database.maximal-journal-size 1048576 &
64+
--server.jwt-secret=secret_password \
65+
--database.maximal-journal-size 1048576 \
66+
--agency.endpoint=tcp://127.0.0.1:8531 \
67+
--cluster.my-role=COORDINATOR \
68+
--cluster.my-address=tcp://127.0.0.1:8529 &
3669

3770
sleep 2
3871

@@ -45,7 +78,19 @@ if [ "x$process" == "x" ]; then
4578
exit 1
4679
fi
4780

48-
echo "Waiting until ArangoDB is ready on port 8529"
49-
sleep 10
81+
echo "Waiting until ArangoDB Coordinator is ready on port 8529"
82+
timeout=120
83+
n=0
84+
while [[ (-z `curl -k --basic --user "root:" -s "http://127.0.0.1:8529/_api/version" `) && (n -lt timeout) ]] ; do
85+
echo -n "."
86+
sleep 1s
87+
n=$[$n+1]
88+
done
89+
90+
if [[ n -eq timeout ]];
91+
then
92+
echo "Could not start ArangoDB. Timeout reached."
93+
exit 1
94+
fi
5095

5196
echo "ArangoDB is up"

0 commit comments

Comments
 (0)