forked from twitter/twemproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
2,423 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
language: c | ||
script: CFLAGS="-ggdb3 -O0" autoreconf -fvi && ./configure --enable-debug=log && make && sudo make install | ||
script: bash ./travis.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.pyc | ||
*.out | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
Python testing facilities for twemproxy, this test suite is based on https://github.com/idning/redis-mgr | ||
|
||
already add to https://travis-ci.org/idning/twemproxy as travis-ci | ||
|
||
see https://github.com/idning/twemproxy/blob/travis-ci/travis.sh | ||
|
||
usage | ||
===== | ||
|
||
1. install dependency:: | ||
|
||
pip install nose | ||
pip install git+https://github.com/andymccurdy/[email protected] | ||
pip install git+https://github.com/idning/python-memcached.git#egg=memcache | ||
|
||
2. copy binarys to _binaries/:: | ||
|
||
_binaries/ | ||
|-- nutcracker | ||
|-- redis-benchmark | ||
|-- redis-check-aof | ||
|-- redis-check-dump | ||
|-- redis-cli | ||
|-- redis-sentinel | ||
|-- redis-server | ||
|-- memcached | ||
|
||
3. run:: | ||
|
||
$ nosetests -v | ||
test_del.test_multi_delete_on_readonly ... ok | ||
test_mget.test_mget ... ok | ||
|
||
---------------------------------------------------------------------- | ||
Ran 2 tests in 4.483s | ||
|
||
OK | ||
|
||
4. add A case:: | ||
|
||
cp tests/test_del.py tests/test_xxx.py | ||
vim tests/test_xxx.py | ||
|
||
|
||
|
||
variables | ||
========= | ||
:: | ||
|
||
export T_VERBOSE=9 will start nutcracker with '-v 9' (default:4) | ||
export T_MBUF=512 will start nutcracker whit '-m 512' (default:521) | ||
export T_LARGE=10000 will test 10000 keys for mget/mset (default:1000) | ||
|
||
T_LOGFILE: | ||
|
||
- to put test log on stderr:: | ||
|
||
export T_LOGFILE=- | ||
|
||
- to put test log on t.log:: | ||
|
||
export T_LOGFILE=t.log | ||
|
||
or:: | ||
|
||
unset T_LOGFILE | ||
|
||
|
||
notes | ||
===== | ||
|
||
- After all the tests. you may got a core because we have a case in test_signal which will send SEGV to nutcracker | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#coding: utf-8 | ||
|
||
import os | ||
import sys | ||
|
||
PWD = os.path.dirname(os.path.realpath(__file__)) | ||
WORKDIR = os.path.join(PWD, '../') | ||
|
||
BINARYS = { | ||
'REDIS_SERVER_BINS' : os.path.join(WORKDIR, '_binaries/redis-*'), | ||
'REDIS_CLI' : os.path.join(WORKDIR, '_binaries/redis-cli'), | ||
'MEMCACHED_BINS' : os.path.join(WORKDIR, '_binaries/memcached'), | ||
'NUTCRACKER_BINS' : os.path.join(WORKDIR, '_binaries/nutcracker'), | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
start() | ||
{ | ||
stop | ||
ulimit -c unlimited | ||
|
||
pushd . > /dev/null | ||
|
||
cd `dirname $$0` | ||
${startcmd} | ||
popd | ||
} | ||
|
||
stop() | ||
{ | ||
pkill -9 -f '${runcmd}' | ||
} | ||
|
||
case C"$$1" in | ||
C) | ||
echo "Usage: $$0 {start|stop}" | ||
;; | ||
Cstart) | ||
start | ||
echo "Done!" | ||
;; | ||
Cstop) | ||
stop | ||
echo "Done!" | ||
;; | ||
C*) | ||
echo "Usage: $$0 {start|stop}" | ||
;; | ||
esac | ||
|
||
|
||
|
Oops, something went wrong.