Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for 
change notification.

The "HowToContribute" page has been changed by TylerHobbs:
https://wiki.apache.org/cassandra/HowToContribute?action=diff&rev1=55&rev2=56

Comment:
Update instructions for running tests

  == Testing and Coverage ==
  Setting up and running system tests:
  
+ === Running the Unit Tests ===
+ Simply run `ant` to run all unit tests. To run a specific test class, run 
`ant -Dtest.name=<ClassName>`.  To run a specific test method, run `ant 
-Dtestsome.name=<ClassName> -Dtestsome.methods=<comma-separated list of method 
names>`.
- === Running the functional tests for Thrift RPC ===
-  1. Install CQL: `svn checkout 
https://svn.apache.org/repos/asf/cassandra/drivers; cd drivers/py; python 
setup.py build; sudo python setup.py install`.
-  1. Install the 
[[http://somethingaboutorange.com/mrl/projects/nose/0.11.1/|nose]] test runner 
(`aptitude install python-nose`, `easy_install nose`, etc).
-  1. Install the Thrift compiler (see InstallThrift) and Python libraries (`cd 
thrift/lib/py && python setup.py install`).
-  1. Generate Cassandra's Python code using `ant gen-thrift-py`.
-  1. Build the source `ant clean build`.
-  1. Run `nosetests test/system/` from the top-level source directory.
  
- If you need to modify the system tests, you probably only need to care about 
test/system/test_thrift_server.py.  (test/system/__init__.py takes care of 
spawning new cassandra instances for each test and cleaning up afterwards so 
they are isolated.)
+ You can also run tests in parallel: `ant test -Dtest.runners=4`.
+ 
+ === Running the dtests ===
+ The dtests use [[https://github.com/pcmanus/ccm|ccm]] to test a local cluster.
+  1. Install ccm.  You can do this with pip by running `pip install ccm`.
+  1. Install nosetests.  With pip, this is `pip install nose`.
+  1. Clone the dtest repo: https://github.com/riptano/cassandra-dtest.git
+  1. Set `$CASSANDRA_DIR` to the location of your cassandra checkout.  For 
example: `export CASSANDRA_DIR=/home/joe/cassandra`.  Make sure you've already 
built cassandra in this directory.
+  1. Run all tests by running `nosetests` from the dtest checkout.  You can 
run a specific module like so: `nosetests cql_tests.py`.  You can run a 
specific test method like this: `nosetests cql_tests.py:TestCQL.counters_test`
  
  === Running the code coverage task ===
   1. Unzip this one: 
http://sourceforge.net/projects/cobertura/files/cobertura/1.9.4.1/cobertura-1.9.4.1-bin.zip/download

Reply via email to