From 5b3f11b8cebb379bdb5e1b0082e55cf7a807874c Mon Sep 17 00:00:00 2001 From: Tyler Hobbs Date: Tue, 15 Jul 2014 14:29:58 -0500 Subject: [PATCH] Add more test and benchmark instructions to README-dev.rst --- README-dev.rst | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/README-dev.rst b/README-dev.rst index 5242e5d3..1dcd6084 100644 --- a/README-dev.rst +++ b/README-dev.rst @@ -58,6 +58,39 @@ You can run a specific test module or package like so:: python setup.py nosetests -w tests/unit/ +You can run a specific test method like so:: + + python setup.py nosetests -w tests/unit/test_connection.py:ConnectionTest.test_bad_protocol_version + +Seeing Test Logs in Real Time +----------------------------- +Sometimes it's useful to output logs for the tests as they run:: + + python setup.py nosetests -w tests/unit/ --nocapture --nologcapture + +Use tee to capture logs and see them on your terminal:: + + python setup.py nosetests -w tests/unit/ --nocapture --nologcapture 2>&1 | tee test.log + +Specifying a Cassandra Version for Integration Tests +---------------------------------------------------- +You can specify a cassandra version with the ``CASSANDRA_VERSION`` environment variable:: + + CASSANDRA_VERSION=2.0.9 python setup.py nosetests -w tests/integration/standard + +You can also specify a cassandra directory (to test unreleased versions):: + + CASSANDRA_DIR=/home/thobbs/cassandra python setup.py nosetests -w tests/integration/standard + +Specify a Protocol Version for Tests +------------------------------------ +The protocol version defaults to 1 for cassandra 1.2 and 2 otherwise. You can explicitly set +it with the ``PROTOCOL_VERSION`` environment variable:: + + PROTOCOL_VERSION=3 python setup.py nosetests -w tests/integration/standard + +Testing Multiple Python Versions +-------------------------------- If you want to test all of python 2.6, 2.7, and pypy, use tox (this is what TravisCI runs):: @@ -70,3 +103,13 @@ tests should work locally. To run them, edit the following line in tox.ini:: commands = {envpython} setup.py build_ext --inplace nosetests --verbosity=2 tests/unit/ and change ``tests/unit/`` to ``tests/``. + +Running the Benchmarks +====================== +To run the benchmarks, pick one of the files under the ``benchmarks/`` dir and run it:: + + python benchmarks/future_batches.py + +There are a few options. Use ``--help`` to see them all:: + + python benchmarks/future_batches.py --help