Add more test and benchmark instructions to README-dev.rst
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user