forked from rockset/rocksdb-cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.sh
executable file
·99 lines (81 loc) · 2.65 KB
/
run_tests.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
set -eu
args=$(getopt -o '+hj:' -l 'help,parallel_jobs:' -n "$0" -- "$@")
eval set -- "$args"
set +e
read -r -d '' usage_str <<END
Usage:
$0 [options...]
Entry-point for the RocksDB-Cloud test script.
Options:
-h, --help Help
-j, --parallel_jobs Quiet
END
set -e
die_usage() {
echo "$@" >&2
echo >&2
echo "$usage_str" >&2
exit 1
}
die_error() {
echo "$1" >& 2
exit 1
}
while :; do
case "$1" in
-h|--help)
echo "$usage_str"
exit 0
;;
-j|--parallel_jobs)
PARALLEL_JOBS="$2"
shift
;;
--)
shift
break
;;
*)
die "Internal error: unknown option $1"
esac
shift
done
echo "Running with $PARALLEL_JOBS parallel jobs"
echo "Pulling base image..."
docker pull rockset/rocksdb_cloud_runtime:test
echo "Checking AWS access keys"
if [[ -z ${AWS_ACCESS_KEY_ID+x} ]]; then
AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id) || die_error "AWS access key ID not found"
fi
if [[ -z ${AWS_SECRET_ACCESS_KEY+x} ]]; then
AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key) || die_error "AWS secret access key not found"
fi
export AWS_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY
export SRC_ROOT=$(git rev-parse --show-toplevel)
echo $UID
echo "Building tests..."
docker run -v $SRC_ROOT:/opt/rocksdb-cloud/src -w /opt/rocksdb-cloud/src \
-u $UID -e V=1 -e USE_AWS=1 -e USE_KAFKA=1 \
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \
--rm rockset/rocksdb_cloud_runtime:test \
/bin/bash -c "make -j4 db_test db_test2 db_basic_test env_basic_test db_cloud_test cloud_manifest_test"
echo "Running db_test. This test might take a while. Get some coffee :)"
docker run -v $SRC_ROOT:/opt/rocksdb-cloud/src -w /opt/rocksdb-cloud/src \
-u $UID -e V=1 -e USE_AWS=1 -e USE_KAFKA=1 \
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \
--rm rockset/rocksdb_cloud_runtime:test \
/bin/bash -c "./db_test"
echo "Running db_test2, db_basic_test and env_basic_test"
docker run -v $SRC_ROOT:/opt/rocksdb-cloud/src -w /opt/rocksdb-cloud/src \
-u $UID -e V=1 -e USE_AWS=1 -e USE_KAFKA=1 \
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \
--rm rockset/rocksdb_cloud_runtime:test \
/bin/bash -c "./db_test2 && ./db_basic_test && ./env_basic_test"
echo "Running cloud tests..."
docker run -v $SRC_ROOT:/opt/rocksdb-cloud/src -w /opt/rocksdb-cloud/src \
-u $UID -e V=1 -e USE_AWS=1 -e USE_KAFKA=1 \
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \
--rm rockset/rocksdb_cloud_runtime:test \
/bin/bash -c "./cloud_manifest_test && ./db_cloud_test --gtest_filter=-CloudTest.KeepLocalLogKafka"