[tor-bugs] #9865 [BridgeDB]: Create a test harness for BridgeDB
Tor Bug Tracker & Wiki
blackhole at torproject.org
Tue Oct 1 21:00:29 UTC 2013
#9865: Create a test harness for BridgeDB
-----------------------------------------+---------------------
Reporter: isis | Owner:
Type: task | Status: new
Priority: normal | Milestone:
Component: BridgeDB | Version:
Keywords: bridgedb,bridgedb-unittests | Actual Points:
Parent ID: | Points:
-----------------------------------------+---------------------
BridgeDB's tests are currently stored in lib/BridgeDB/Tests.py and use the
standard library's `unittest` module. Normally, Twisted code is tested
with `twisted.trial`, for the reason that if something returns a
`twisted.internet.defer.Deferred` the stdlib `unittest` module doesn't
know to wait for the result (nor does it understand how to clear the
reactor).
Some things which should be done:
* We need a test runner which can pass on commands (i.e. doing "python
setup.py test" would actually run "trial coverage [args] [tests/test
directory]" and pass the arguments and test cases to coverage if need be.
See tahoe-lafs's code for an example) and environment variables (i.e.
`PYTHONPATH`).
* `twisted.trial` has a conversion utility class for translating test
results from stdlib `unittest` into something which `trial`'s reporter can
use. I've never used it, but either some sort of conversion should be done
of the old tests, or they should be rewritten.
* Find a way to write integration tests for the web
interface.[http://www.getwindmill.com/ Windmill]
([https://github.com/windmill/windmill/wiki/IDE more docs]) and
[http://twill.idyll.org/python-api.html twill] look promising. Windmill
probably wouldn't run very nicely on a headless server, however, as it
drives a browser.
* Find a way to write tests for the email responder.
If we get all this running, we can setup Travis-CI and get automated
continuous integration, which should help prevent bugs like #9626 and
#9156.
Useful Resources:
http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9865>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list