Run the integration tests
28 Apr 2008
We're going to show how you can run the integration tests (aka. unit tests) on your own system. This can be very helpful for helping out with reporting bugs.
Version requirement:
First you need to install Zope 2.8, 2.9 or 2.10 all of which are available from zope.org
The instructions for how to install Zope is going to have to be a story on its own. More than likely, you'll already have a Zope installed somewhere. Perhaps even better you already have a working copy of IssueTrackerProduct installed in that Zope. Let's then assume that you have Zope installed and everything, then all we need is the command to run the tests.
Before we run any tests, if you have installed CheckoutableTemplates you need to set the following environment variable so that CheckoutableTemplates aren't part of the test. Do that this way in unix type operating systems:
export DISABLE_CHECKOUTABLE_TEMPLATES=1
Now you can run the tests from the Zope instance home directory:
./bin/zopectl test --dir Products/IssueTrackerProduct/tests/
This will the install all the necessary products and run the Zope lite server and run the tests. If all goes well you will get this response at the very end:
Ran 76 tests in 1.303s
Perhaps this number is higher by the time you run the tests as you perhaps use a more recent version of the IssueTrackerProduct than this how-to which hopefully contains more tests.