forked from tsuru/rpaas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (43 loc) · 1.68 KB
/
Makefile
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
# Copyright 2016 rpaas authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
.PHONY: test deps
clean_pycs:
find . -name \*.pyc -delete
run: deps
python ./rpaas/api.py
worker: deps
celery -A rpaas.tasks worker
flower: deps
celery flower -A rpaas.tasks
start-consul: stop-consul
consul agent -ui -server -bind 127.0.0.1 -bootstrap-expect 1 -data-dir /tmp/consul -config-file etc/consul.conf -node=rpaas-test &
while ! consul info; do sleep 1; done
stop-consul:
-consul leave
rm -rf /tmp/consul
test: start-consul ci-test
ci-test: clean_pycs deps redis-sentinel-test
@python -m unittest discover
@flake8 --max-line-length=120 .
deps:
pip install -e .[tests]
coverage: deps
rm -f .coverage
coverage run --source=. -m unittest discover
coverage report -m --omit=test\*,run\*.py
kill-redis-sentinel-test:
-redis-cli -a mypass -p 51115 shutdown
-redis-cli -a mypass -p 51114 shutdown
-redis-cli -a mypass -p 51113 shutdown
-redis-cli -p 51112 shutdown
-redis-cli -p 51111 shutdown
redis-sentinel-test: kill-redis-sentinel-test copy-redis-conf
redis-sentinel /tmp/redis_sentinel_test.conf --daemonize yes || redis-server /tmp/redis_sentinel_test.conf --sentinel --daemonize yes; sleep 1
redis-sentinel /tmp/redis_sentinel2_test.conf --daemonize yes || redis-server /tmp/redis_sentinel2_test.conf --sentinel --daemonize yes; sleep 1
redis-server /tmp/redis_test.conf --daemonize yes; sleep 1
redis-server /tmp/redis_test2.conf --daemonize yes; sleep 1
redis-server /tmp/redis_test3.conf --daemonize yes; sleep 1
redis-cli -p 51111 info | grep sentinel
copy-redis-conf:
@cp tests/testdata/sentinel_conf/*.conf /tmp