st-augustin-sprint
Sep 13, 2006
Running Tests
From the First-things-first-department
Yesterday was a bit frustrating — I’ve basically spent all day battling my local setup of Zope and trying to get all relevant tests of my review bundle to run — as long as they don’t I needn’t even bother to do any actual work on the plip itself… Apart from plain stupid typo mistakes in my EXTERNALS.txt, general connectivity problems etc.) there is one lesson for me to take home: run tests with zopectl not runalltests.py!
For example, I needed to run the tests of my freshly cut Archetypes branch, which failed:
cd /opt/zope/instances/plip149/zope/Products/Archetypes
python tests/runalltests.py
[...] # lots of output
File "/Data/opt/zope/instances/plip149/zope/Products/CMFPlone/migrations/v3_0/alphas.py", line 2, in ?
ImportError: No module named globalregistry
However, using zopectl test worked just fine. I.e. to run all tests of the Archetypes product:
cd /opt/zope/instances/plip149/zope/
./bin/zopectl test -s Products.Archetypes
The -s parameter selects the package, but you can also additionally use -m to select a specific module, i.e. to just run tests/test_utils.py:
./bin/zopectl test -s Products.Archetypes -m test_utils
Now the tests ran just fine and I can finally get back to work on the actual plip ;-)
Sep 12, 2006
How to build Zope
From the Little-Things-Department
We've all arrived safely at the St. Augustin Sprint (although we're lounging in our rented apartment in central Cologne at the moment, but that's another story involving copious amounts of the local beer simulation named Kölsch...)
One of the great things about sprints are the tiny little hints that get passed around as one sits together. This one is about building Zope from source. Usually that involves downloading and expanding the source into a source directory (or updating a subversion checkout), building it, installing it and then running mkzopeinstance from the software directory that has been created by the installation. If you're following trunk this can become necessary quite often. So here's how Hanno Schlichting (a.ka. the guy next to me on the couch) does it:
python setup.py build_ext -i
The -i option tells setup.py to build in-place, i.e. into the directory you've checked out, meaning that your source directory and software directory are identical. The clou is, when you re-build Zope after a svn-update, the build process is smart enough to only rebuild modified sources, thus reducing the build process to just a few seconds in many cases.
Update: setup.py creates a different directory structure than make install, so e.g. mkzopeinstance is now located in utilities rather than bin. But you found that out yourself already, probably ;-)
