Skip to content

Commit

Permalink
add test-twemproxy to travis
Browse files Browse the repository at this point in the history
  • Loading branch information
idning committed Apr 24, 2015
1 parent cfbc0bb commit 52ad27e
Show file tree
Hide file tree
Showing 24 changed files with 2,423 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
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

3 changes: 3 additions & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pyc
*.out
*.log
74 changes: 74 additions & 0 deletions tests/README.rst
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


1 change: 1 addition & 0 deletions tests/_binaries/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
15 changes: 15 additions & 0 deletions tests/conf/conf.py
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'),
}

38 changes: 38 additions & 0 deletions tests/conf/control.sh
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



Loading

0 comments on commit 52ad27e

Please sign in to comment.