-
-
Notifications
You must be signed in to change notification settings - Fork 56
/
Makefile.tests
112 lines (93 loc) · 4.33 KB
/
Makefile.tests
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
100
101
102
103
104
105
106
107
108
109
110
111
112
ifneq ("$(wildcard ./google-cloud-sdk/platform/google_appengine/VERSION)","")
GAE_INSTALLED = 1
else
GAE_INSTALLED = 0
endif
PY_VERSION =$(shell python -c "import sys;print('.'.join(str(k) for k in sys.version_info[0:2]))")
clean:
-rm -f MANIFEST
-rm -rf dist/
-rm -rf build/
cleancov:
-rm -rf htmlcov/
-coverage combine
-coverage erase
cleanmeta:
-rm -rf limits.egg-info/
cleanall: clean cleancov cleanmeta
-find . -type f -name "*~" -exec rm -f "{}" \;
-find . -type f -name "*.orig" -exec rm -f "{}" \;
-find . -type f -name "*.rej" -exec rm -f "{}" \;
-find . -type f -name "*.pyc" -exec rm -f "{}" \;
-find . -type f -name "*.parse-index" -exec rm -f "{}" \;
sdist: cleanmeta
python setup.py sdist
bdist: cleanmeta
python setup.py bdist_egg
install:
python setup.py install
redis-start: redis-cleanup
redis-server tests/redis-configurations/basic.conf
redis-server tests/redis-configurations/passwd.conf
redis-server tests/redis-configurations/unixdomainsocket.conf
redis-server tests/redis-configurations/cluster/redis-0.conf
redis-server tests/redis-configurations/cluster/redis-1.conf
redis-server tests/redis-configurations/cluster/redis-2.conf
redis-server tests/redis-configurations/cluster/redis-3.conf
redis-server tests/redis-configurations/cluster/redis-4.conf
redis-server tests/redis-configurations/cluster/redis-5.conf
redis-server tests/redis-configurations/sentinel/redis-master.conf
redis-server tests/redis-configurations/sentinel/redis-slave.conf
redis-server tests/redis-configurations/sentinel/redis-sentinel.conf --sentinel
echo "yes" | redis-cli --cluster create --cluster-replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005
sleep 5
redis-cleanup:
- rm -vf /tmp/redis_cluster_node*.conf 2>/dev/null
- rm -rf dump.rdb appendonly.aof - 2>/dev/null
redis-stop:
[ -e /tmp/redis_cluster_node0.pid ] && kill -9 `cat /tmp/redis_cluster_node0.pid` || true
[ -e /tmp/redis_cluster_node1.pid ] && kill -9 `cat /tmp/redis_cluster_node1.pid` || true
[ -e /tmp/redis_cluster_node2.pid ] && kill -9 `cat /tmp/redis_cluster_node2.pid` || true
[ -e /tmp/redis_cluster_node3.pid ] && kill -9 `cat /tmp/redis_cluster_node3.pid` || true
[ -e /tmp/redis_cluster_node4.pid ] && kill -9 `cat /tmp/redis_cluster_node4.pid` || true
[ -e /tmp/redis_cluster_node5.pid ] && kill -9 `cat /tmp/redis_cluster_node5.pid` || true
[ -e /tmp/redis-sentinel.pid ] && kill -9 `cat /tmp/redis-sentinel.pid` || true
[ -e /tmp/redis-master.pid ] && kill -9 `cat /tmp/redis-master.pid` || true
[ -e /tmp/redis-slave.pid ] && kill -9 `cat /tmp/redis-slave.pid` || true
[ -e /tmp/redis_unix-domain-socket.pid ] && kill -9 `cat /tmp/redis_unix-domain-socket.pid` || true
[ -e /tmp/redis_basic.pid ] && kill -9 `cat /tmp/redis_basic.pid` || true
[ -e /tmp/redis_basic_passwd.pid ] && kill -9 `cat /tmp/redis_basic_passwd.pid` || true
rm -f /tmp/redis_cluster_node0.conf
rm -f /tmp/redis_cluster_node1.conf
rm -f /tmp/redis_cluster_node2.conf
rm -f /tmp/redis_cluster_node3.conf
rm -f /tmp/redis_cluster_node4.conf
rm -f /tmp/redis_cluster_node5.conf
memcached-start:
memcached -d -p 22122 -P /tmp/limits.memcached.1.pid
memcached -d -p 22123 -P /tmp/limits.memcached.2.pid
memcached -d -s /tmp/limits.memcached.sock -P /tmp/limits.memcached.uds.pid
memcached-stop:
[ -e /tmp/limits.memcached.1.pid ] && kill `cat /tmp/limits.memcached.1.pid` || true
[ -e /tmp/limits.memcached.2.pid ] && kill `cat /tmp/limits.memcached.2.pid` || true
[ -e /tmp/limits.memcached.uds.pid ] && kill `cat /tmp/limits.memcached.uds.pid` || true
rm -rf /tmp/limits.memcached.*.pid
memcached-gae-install:
ifeq ($(PY_VERSION),2.7)
ifeq ($(GAE_INSTALLED),0)
export CLOUDSDK_PYTHON=$$(which python)
wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-167.0.0-linux-x86_64.tar.gz -P /var/tmp/;
rm -rf google-cloud-sdk
tar -xzf /var/tmp/google-cloud-sdk-167.0.0-linux-x86_64.tar.gz
yes Y | google-cloud-sdk/bin/gcloud components install app-engine-python
else
echo "GAE SDK already setup"
endif
ln -sf google-cloud-sdk/platform/google_appengine/google google
endif
memcached-gae-clean:
rm google-cloud-sdk-167.0.0-linux-x86_64.tar.gz
rm -r google-cloud-sdk
tests: redis-stop memcached-stop redis-start memcached-gae-install memcached-start
nosetests tests --with-cov -v --with-timer --timer-top-n 10
.PHONY: test