-
Notifications
You must be signed in to change notification settings - Fork 171
/
run-tests.sh
executable file
·95 lines (82 loc) · 2.31 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
#!/bin/bash
set -eo pipefail
# Run tests with various configurations.
if [[ -z "$TEST_COMMAND" ]]; then
if [[ -z "$CARGO_HOME" ]]; then
CARGO_HOME="$HOME/.cargo"
fi
if command -v cargo-nextest || [[ -e "$CARGO_HOME/bin/cargo-nextest" ]]; then
TEST_COMMAND="cargo nextest run"
else
TEST_COMMAND="cargo test"
fi
fi
# Common variables:
export DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
export SVIX_JWT_SECRET="test value"
export SVIX_LOG_LEVEL="info"
export SVIX_WHITELIST_SUBNETS="[127.0.0.1/32]"
export SVIX_DB_POOL_MAX_SIZE="500"
export SVIX_REDIS_POOL_MAX_SIZE="10000"
echo "*********** RUN 1 ***********"
(
export SVIX_QUEUE_TYPE="redis"
export SVIX_CACHE_TYPE="redis"
export SVIX_REDIS_DSN="redis://localhost:6379"
${TEST_COMMAND} "$@"
if [[ -z "$@" ]]; then
${TEST_COMMAND} -- --ignored redis
fi
)
echo "*********** RUN 2 ***********"
(
export SVIX_QUEUE_TYPE="redis"
export SVIX_CACHE_TYPE="memory"
export SVIX_REDIS_DSN="redis://localhost:6379"
${TEST_COMMAND} "$@"
)
echo "*********** RUN 3 ***********"
(
export SVIX_QUEUE_TYPE="redis"
export SVIX_CACHE_TYPE="none"
export SVIX_REDIS_DSN="redis://localhost:6379"
${TEST_COMMAND} "$@"
)
echo "*********** RUN 4 ***********"
(
export SVIX_QUEUE_TYPE="rediscluster"
export SVIX_CACHE_TYPE="rediscluster"
export SVIX_REDIS_DSN="redis://localhost:6380"
${TEST_COMMAND} "$@"
if [[ -z "$@" ]]; then
${TEST_COMMAND} -- --ignored redis
fi
)
echo "*********** RUN 5 ***********"
(
export SVIX_QUEUE_TYPE="memory"
export SVIX_CACHE_TYPE="none"
${TEST_COMMAND} "$@"
)
echo "*********** RUN 6 ***********"
(
export SVIX_QUEUE_TYPE="rabbitmq"
export SVIX_CACHE_TYPE="redis"
export SVIX_REDIS_DSN="redis://localhost:6379"
export SVIX_RABBIT_DSN="amqp://xivs:xivs@localhost:5672/%2f"
${TEST_COMMAND} "$@"
if [[ -z "$@" ]]; then
${TEST_COMMAND} -- --ignored rabbitmq
fi
)
echo "*********** RUN 7 ***********"
(
export SVIX_QUEUE_TYPE="redissentinel"
export SVIX_CACHE_TYPE="redissentinel"
export SVIX_REDIS_DSN="redis://localhost:26379"
export SVIX_SENTINEL_SERVICE_NAME="master0"
${TEST_COMMAND} "$@"
if [[ -z "$@" ]]; then
${TEST_COMMAND} -- --ignored redis
fi
)