Add new support for easily testing Review Board extensions.
Review Request #8295 — Created July 19, 2016 and submitted — Latest diff uploaded
This introduces a new TestCase class and a command line tool for easily
unit testing Review Board extensions.The new
ExtensionTestCase
can be used by extension authors to create
unit tests that make use of an enabled instance of the extension. This
makes use of Djblets's new testing support, and also allows for the
usage of the handy object creation methods we have in Review Board's
mainTestCase
class.A new
rbext test
command is now provided, which makes it easy to run
an extension's test suite. This works similarly to other test runners
likenosetests
, but sets up a suitable Review Board environment in which
to run the tests.To make that work well, and to consolidate code, the main Review Board
test runner now makes use of Djblets's newTestRunner
class. This means
that both Review Board and any extensions will be running in the same
kind of environment.Documentation has been added describing how to make use of all this to
write and run test suites.
Ran the Review Board test suite.
Updated an extension to use
ExtensionTestCase
, and then ran the
test suite usingrbext test
. I also tried a variety of other
options (built-in and throughnosetests
), and tried running
subsets of tests. All worked.Read through the new docs and verified that the formatting and
linking was all correct.