forked from alisaifee/limits
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile.tests
More file actions
106 lines (87 loc) · 3.4 KB
/
Makefile.tests
File metadata and controls
106 lines (87 loc) · 3.4 KB
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
PATH := ./redis-git/src:${PATH}
ifndef REDIS_TRIB_RB
REDIS_TRIB_RB=redis-git/src/redis-trib.rb
endif
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-git/src/redis-server tests/redis-configurations/cluster/redis-0.conf
./redis-git/src/redis-server tests/redis-configurations/cluster/redis-1.conf
./redis-git/src/redis-server tests/redis-configurations/cluster/redis-2.conf
./redis-git/src/redis-server tests/redis-configurations/cluster/redis-3.conf
./redis-git/src/redis-server tests/redis-configurations/cluster/redis-4.conf
./redis-git/src/redis-server tests/redis-configurations/cluster/redis-5.conf
./redis-git/src/redis-server tests/redis-configurations/sentinel/redis-master.conf
./redis-git/src/redis-server tests/redis-configurations/sentinel/redis-slave.conf
./redis-git/src/redis-server tests/redis-configurations/sentinel/redis-sentinel.conf --sentinel
echo "yes" | ruby $(REDIS_TRIB_RB) create --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 dump.rdb appendonly.aof - 2>/dev/null
redis-stop:
kill `cat /tmp/redis_cluster_node0.pid` || true
kill `cat /tmp/redis_cluster_node1.pid` || true
kill `cat /tmp/redis_cluster_node2.pid` || true
kill `cat /tmp/redis_cluster_node3.pid` || true
kill `cat /tmp/redis_cluster_node4.pid` || true
kill `cat /tmp/redis_cluster_node5.pid` || true
kill `cat /tmp/redis-sentinel.pid` || true
kill `cat /tmp/redis-master.pid` || true
kill `cat /tmp/redis-slave.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
redis-install:
[ ! -e redis-git/.git ] && git clone --depth 1 --branch 3.2.8 https://github.com/antirez/redis.git redis-git || true
make -C redis-git -j4
gem install redis
sleep 3
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-install redis-start memcached-gae-install
nosetests tests --with-cov -v
.PHONY: test