-
Notifications
You must be signed in to change notification settings - Fork 143
/
.travis.yml
71 lines (57 loc) · 2.51 KB
/
.travis.yml
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
sudo: required
dist: trusty
language: c
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq valgrind
install:
- wget http://download.redis.io/releases/redis-3.0.7.tar.gz
- tar xzf redis-3.0.7.tar.gz
- cd redis-3.0.7
- make
- sudo cp src/redis-server `which redis-server`
- cd ../
- sudo mkdir -p /etc/redis /var/lib/redis/cluster/{8000,8001,8002,8003}
- sudo chmod -R 777 /etc/redis
- echo "port {port}" > /etc/redis/redis-cluster.conf
- echo "dir /var/lib/redis/cluster/{port}" >> /etc/redis/redis-cluster.conf
- echo "cluster-enabled yes" >> /etc/redis/redis-cluster.conf
- echo "daemonize yes" >> /etc/redis/redis-cluster.conf
- sed 's/{port}/8000/' /etc/redis/redis-cluster.conf > /etc/redis/redis-cluster-8000.conf
- sed 's/{port}/8001/' /etc/redis/redis-cluster.conf > /etc/redis/redis-cluster-8001.conf
- sed 's/{port}/8002/' /etc/redis/redis-cluster.conf > /etc/redis/redis-cluster-8002.conf
- sed 's/{port}/8003/' /etc/redis/redis-cluster.conf > /etc/redis/redis-cluster-8003.conf
- sudo chmod -R 700 /etc/redis
- sudo redis-server /etc/redis/redis-cluster-8000.conf
- sudo redis-server /etc/redis/redis-cluster-8001.conf
- sudo redis-server /etc/redis/redis-cluster-8002.conf
- sudo redis-server /etc/redis/redis-cluster-8003.conf
- redis-server -v
- sudo pip install redis==2.10.5
- sudo pip install ruskit
- pip freeze
- ruskit create localhost:800{0,1,2}
- sed -i 's/node localhost:8000,localhost:8001,localhost:8002/node 127.0.0.1:8000/' corvus.conf
- sed -i 's/loglevel debug/loglevel info/' corvus.conf
- sed -i 's/# statsd localhost/statsd 127.0.0.1/' corvus.conf
- sed -i 's/# metric_interval 10/metric_interval 3/' corvus.conf
- cat corvus.conf
before_script:
- sudo pip install -r tests/requirements.txt
- make deps
- make
- valgrind --leak-check=full ./src/corvus ./corvus.conf > valgrind.log 2>&1 &
- sleep 1 && redis-benchmark -h localhost -p 12345 -t ping_mbulk,get,set,incr,mset,lrange,sadd -q -n 10000 -r 1000000 -P 12
- sleep 1 && kill -INT `pgrep -f corvus` && sleep 1
- cat valgrind.log
- for p in {8000..8002}; do redis-cli -h localhost -p $p flushall; done
- ./src/corvus ./corvus.conf > corvus.log 2>&1 &
script:
- awk '/ERROR SUMMARY/ {if ($4 == 0) exit 0; else exit 1}' valgrind.log
- make clean || true
- make test
- valgrind --error-exitcode=1 --leak-check=full ./tests/corvus_test --silent
- sudo py.test -v tests/test_corvus.py
after_script:
- kill -INT `pgrep -f corvus` && sleep 0.1
- cat corvus.log