[Zope-dev] Re: Running all unittests in $INSTANCE_HOME

Paul Winkler pw_lists at slinkp.com
Fri Nov 18 09:47:42 EST 2005


On Fri, Nov 18, 2005 at 08:43:24AM -0500, Tres Seaver wrote:
> Chris Withers wrote:
> > Paul Winkler wrote:
> >> "./bin/zopectl test"  is supposed to do the job.
> >> But in practice, so many third-party product tests either have
> >> broken dependencies or pollute the test environment somehow
> >> that something always breaks.
> > 
> > 
> > bin/zopectl test Products/MyProduct
> > 
> > ...has worked fine for me for many months now...
> 
> Hmm, that should be a dotted name, rather than a path:
> 
>  $ bin/zopectl test Products.MyProduct
> 
> Because the first argument is interpreted as a regex, using search, you
> can leave the 'Product.' bit off, as well as supplying more complicated
> specifications, e.g.:
> 
>  $ bin/zopectl test OneProduct|AnotherProduct

Thanks for the hints, guys.
The latter form seems to need quoting, at least under bash,
to avoid the shell treating it as a pipe. So it would be

  $ bin/zopectl test "OneProduct|AnotherProduct"

Anyway, my point is, you often can't just run everything because stuff 
breaks. And even with the "Foo|Bar" pattern, stuff still sometimes
breaks, due to test environment pollution or other nastiness. The
current worst offender I have installed is ZWiki 0.47 which kills the
entire test run if it's installed, no matter what you give for the
regex. I have no idea how it does that and yet manages to run just fine
when you start Zope.  Minor annoyances come from products like
AdvancedQuery 0.6 whose tests depend on other packages that the product
itself does not depend on, but at least it doesn't affect the rest of
the test run.

Example:

pw at kermit NavCodeInstanceHome $ ./bin/zopectl test Products.BTreeFolder2
/usr/lib/python2.4/whrandom.py:38: DeprecationWarning: the whrandom
module is deprecated; please use the random module
  DeprecationWarning)
Running tests via: /usr/bin/python /home/pw/Zope-2.7.7-final/bin/test.py
-v --config-file /home/pw/NavCodeInstanceHome/etc/zope.conf --libdir
Products Products.BTreeFolder2
Running unit tests at level 1
Running unit tests from /home/pw/NavCodeInstanceHome/Products
Parsing /home/pw/NavCodeInstanceHome/etc/zope.conf
/usr/lib/python2.4/whrandom.py:38: DeprecationWarning: the whrandom
module is deprecated; please use the random module
  DeprecationWarning)
Traceback (most recent call last):
  File "/home/pw/Zope-2.7.7-final/bin/test.py", line 918, in ?
    process_args()
  File "/home/pw/Zope-2.7.7-final/bin/test.py", line 908, in
process_args
    bad = main(module_filter, test_filter, libdir)
  File "/home/pw/Zope-2.7.7-final/bin/test.py", line 677, in main
    files = find_tests(module_filter)
  File "/home/pw/Zope-2.7.7-final/bin/test.py", line 478, in find_tests
    walk_with_symlinks(pathinit.testdir, finder.visit, rx)
  File "/home/pw/Zope-2.7.7-final/bin/test.py", line 628, in
walk_with_symlinks
    walk_with_symlinks(name, visit, arg)
  File "/home/pw/Zope-2.7.7-final/bin/test.py", line 628, in
walk_with_symlinks
    walk_with_symlinks(name, visit, arg)
  File "/home/pw/Zope-2.7.7-final/bin/test.py", line 622, in
walk_with_symlinks
    visit(arg, path, names)
  File "/home/pw/Zope-2.7.7-final/bin/test.py", line 458, in visit
    __import__(pkg)
  File "/home/pw/NavCodeInstanceHome/Products/ZWiki/__init__.py", line
12, in ?
    import ZWikiPage, ZWikiWeb, Permissions, Defaults, OutlineSupport
  File "/home/pw/NavCodeInstanceHome/Products/ZWiki/ZWikiPage.py", line
87, in ?
    DEFAULT_PAGETYPE = PAGETYPES[0]
IndexError: list index out of range

-- 

Paul Winkler
http://www.slinkp.com


More information about the Zope-Dev mailing list