Add new support for easily testing Review Board extensions.
Review Request #8295 — Created July 19, 2016 and submitted
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.
Description | From | Last Updated |
---|---|---|
A "test" snuck into your description. |
david | |
'six' imported but unused |
reviewbot | |
Col: 1 E402 module level import not at top of file |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
This is a comma splice. |
brennie | |
"handles" |
brennie | |
"light" |
brennie | |
This is sheet |
MP mpietryga |
- Change Summary:
-
Fixed Review Bot complaints.
- Commit:
-
162b5fc578f09e22c501a688742bd3e76c8d04179f788678c2de436584e0dcd9380ad82d55c7edf4
- Diff:
-
Revision 2 (+671 -147)
-
Tool: Pyflakes Processed Files: reviewboard/extensions/testing/__init__.py reviewboard/extensions/tests.py reviewboard/test.py reviewboard/extensions/testing/testcases.py reviewboard/cmdline/rbext.py setup.py Ignored Files: docs/manual/extending/extensions/testing.rst docs/manual/extending/coderef/index.rst docs/manual/extending/extensions/index.rst Tool: PEP8 Style Checker Processed Files: reviewboard/extensions/testing/__init__.py reviewboard/extensions/tests.py reviewboard/test.py reviewboard/extensions/testing/testcases.py reviewboard/cmdline/rbext.py setup.py Ignored Files: docs/manual/extending/extensions/testing.rst docs/manual/extending/coderef/index.rst docs/manual/extending/extensions/index.rst
- Change Summary:
-
Fixed documentation issues.
- Description:
-
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 createunit 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 ~ main TestCase
class.~ main TestCase
class.+ test A new
rbext test
command is now provided, which makes it easy to runan extension's test suite. This works similarly to other test runners like nosetests
, but sets up a suitable Review Board environment in whichto run the tests. To make that work well, and to consolidate code, the main Review Board
test runner now makes use of Djblets's new TestRunner
class. This meansthat 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. - Commit:
-
9f788678c2de436584e0dcd9380ad82d55c7edf43b58b9f35b381962fb99661a02300a8fce962fe6
- Diff:
-
Revision 3 (+671 -147)
-
Tool: Pyflakes Processed Files: reviewboard/extensions/testing/__init__.py reviewboard/extensions/tests.py reviewboard/test.py reviewboard/extensions/testing/testcases.py reviewboard/cmdline/rbext.py setup.py Ignored Files: docs/manual/extending/extensions/testing.rst docs/manual/extending/coderef/index.rst docs/manual/extending/extensions/index.rst Tool: PEP8 Style Checker Processed Files: reviewboard/extensions/testing/__init__.py reviewboard/extensions/tests.py reviewboard/test.py reviewboard/extensions/testing/testcases.py reviewboard/cmdline/rbext.py setup.py Ignored Files: docs/manual/extending/extensions/testing.rst docs/manual/extending/coderef/index.rst docs/manual/extending/extensions/index.rst
- Change Summary:
-
test
- Description:
-
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 createunit 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 ~ main TestCase
class.~ main TestCase
class.- test A new
rbext test
command is now provided, which makes it easy to runan extension's test suite. This works similarly to other test runners like nosetests
, but sets up a suitable Review Board environment in whichto run the tests. To make that work well, and to consolidate code, the main Review Board
test runner now makes use of Djblets's new TestRunner
class. This meansthat 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.