#6 open
Jordan Baker

Lost ZCML registrations

Reported by Jordan Baker | April 19th, 2009 @ 04:19 PM | in 0.3

On 18-Jan-09, at 12:02 AM, Rok Garbas wrote:


i've been a happy user of roadrunner, but i've come to a problem when
using it with custom Five which i'm using it.

it looks to me that zcml meta's was lost. here is traceback, if you
maybe run into some similar case:

Preloading Plone ...
Installing CMFCore ... done (0.956s)
Installing CMFDefault ... done (0.713s)
Installing CMFCalendar ... done (0.195s)
Installing CMFTopic ... done (0.138s)
Installing DCWorkflow ... done (0.218s)
Installing CMFActionIcons ... done (0.062s)
Installing CMFQuickInstallerTool ... done (0.218s)
Installing CMFFormController ... done (1.056s)
Installing GroupUserFolder ... done (1.245s)
Installing ZCTextIndex ... done (0.224s)
Installing CMFPlone ... done (11.340s)
Installing Archetypes ... done (0.432s)
Installing ATContentTypes ... done (0.115s)
Installing ATReferenceBrowserWidget ... done (0.086s)
Installing CMFDynamicViewFTI ... done (0.084s)
Installing ExternalEditor ... done (0.091s)
Installing ExtendedPathIndex ... done (0.091s)
Installing ResourceRegistries ... done (0.087s)
Installing SecureMailHost ... done (0.086s)
Installing CMFPlacefulWorkflow ... done (0.189s)
Installing PasswordResetTool ... done (0.093s)
Installing PluggableAuthService ... done (0.138s)
Installing PluginRegistry ... done (0.092s)
Installing PlonePAS ... done (0.102s)
Installing kupu ... done (1.008s)
Installing CMFEditions ... done (0.329s)
Installing CMFDiffTool ... done (0.182s)
Installing PloneLanguageTool ... done (0.211s)
Set up Products.PloneTestCase.layer.ZCML in 16.517 seconds.
Set up Products.PloneTestCase.layer.PloneSite in 36.411 seconds.
Preloading took: 74.453 seconds.
Running tests at level 1
Installing TinyMCE ... done (0.255s)
Installing LinguaPlone ... done (0.199s)
Installing PloneTranslations ... done (0.111s)
Installing PlacelessTranslationService ... done (7.727s)
Running unit tests:
Ran 29 tests with 0 failures and 0 errors in 1.008 seconds.
Running Products.PloneTestCase.layer.PloneSite tests:
Set up Products.PloneTestCase.layer.PloneSite
Traceback (most recent call last):
File "./bin/roadrunner", line 119, in ?
  roadrunner.runner.plone(zope_conf, preload_modules,
packages_under_test, zope2_location, buildout_home, part_dir)
File "/home/rok/.buildout/eggs/roadrunner-0.2.2-py2.4.egg/roadrunner/runner.py",
line 88, in plone
File "/home/rok/.buildout/eggs/roadrunner-0.2.2-py2.4.egg/roadrunner/testrunner.py",
line 273, in run
  failed = not run_with_options(options, setup_layers=setup_layers)
File "/home/rok/.buildout/eggs/roadrunner-0.2.2-py2.4.egg/roadrunner/testrunner.py",
line 436, in run_with_options
  setup_layers, failures, errors)
File "/home/rok/.buildout/eggs/roadrunner-0.2.2-py2.4.egg/roadrunner/testrunner.py",
line 607, in run_layer
  setup_layer(layer, setup_layers)
File "/home/rok/.buildout/eggs/roadrunner-0.2.2-py2.4.egg/roadrunner/testrunner.py",
line 695, in setup_layer
File "/home/rok/Projects/wieninfo.buildout/branches/garbas-searchwidget/parts/plone/PloneTestCase/layer.py",
line 33, in setUp
  func(*args, **kw)
File "/home/rok/Projects/wieninfo.buildout/branches/garbas-searchwidget/src/WienInfoSite/wieninfo/site/tests.py",
line 32, in setUp
  zcml.load_config('configure.zcml', wieninfo.site)
File "/home/rok/Projects/wieninfo.buildout/branches/garbas-searchwidget/parts/products-thirdparty-svn/Five/zcml.py",
line 62, in load_config
  _context = xmlconfig.file(file, package, _context, execute=execute)
File "/home/rok/Projects/wieninfo.buildout/branches/garbas-searchwidget/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 579, in file
  include(context, name, package)
File "/home/rok/Projects/wieninfo.buildout/branches/garbas-searchwidget/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 515, in include
  processxmlfile(f, context)
File "/home/rok/Projects/wieninfo.buildout/branches/garbas-searchwidget/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 370, in processxmlfile
File "/usr/lib/python2.4/xml/sax/expatreader.py", line 107, in parse
  xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.4/xml/sax/xmlreader.py", line 123, in parse
File "/usr/lib/python2.4/xml/sax/expatreader.py", line 207, in feed
  self._parser.Parse(data, isFinal)
File "/usr/lib/python2.4/xml/sax/expatreader.py", line 337, in
  AttributesNSImpl(newattrs, qnames))
File "/home/rok/Projects/wieninfo.buildout/branches/garbas-searchwidget/parts/zope2/lib/python/zope/configuration/xmlconfig.py",
line 222, in startElementNS
  self.context.begin(name, data, info)
File "/home/rok/Projects/wieninfo.buildout/branches/garbas-searchwidget/parts/zope2/lib/python/zope/configuration/config.py",
line 541, in begin
  self.stack.append(self.stack[-1].contained(__name, __data, __info))
File "/home/rok/Projects/wieninfo.buildout/branches/garbas-searchwidget/parts/zope2/lib/python/zope/configuration/config.py",
line 842, in contained
  return RootStackItem.contained(self, name, data, info)
File "/home/rok/Projects/wieninfo.buildout/branches/garbas-searchwidget/parts/zope2/lib/python/zope/configuration/config.py",
line 710, in contained
  factory = self.context.factory(self.context, name)
File "/home/rok/Projects/wieninfo.buildout/branches/garbas-searchwidget/parts/zope2/lib/python/zope/configuration/config.py",
line 487, in factory
  raise ConfigurationError("Unknown directive", ns, n)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File
line 9.2
  ConfigurationError: ('Unknown directive',
u'http://namespaces.zope.org/five', u'registerPackage')

Comments and changes to this ticket

  • Jordan Baker

    Jordan Baker April 19th, 2009 @ 04:21 PM

    • State changed from “new” to “open”
    • Tag set to five, zcml

    I have run into this problem before and had a potential fix which I never comitted because it was beyond my understanding of how zope's testing frameworks work ;)

    It has something to do with zope cleanup steps.

    Try this and tell me if it works. if you know why it works even better ;)

    def preload_plone(conf):
     print "Preloading Plone ..."
     from Products.PloneTestCase.layer import PloneSite
     from Products.PloneTestCase import PloneTestCase as ptc
    +  # try to disable cleanup steps
    +   import zope.testing.cleanup
    +   zope.testing.cleanup.cleanUp = lambda: None
  • Jordan Baker

    Jordan Baker May 16th, 2009 @ 02:09 AM

    • Milestone set to 0.3
  • Jordan Baker

    Jordan Baker May 18th, 2009 @ 01:41 PM

    Upon some further testing it appears to be reproducible when running unittest prior to the Plone integration tests. This suggests the problem is related to calling cleanups at the end of the unittest. This triggers the previously loaded ZCML layer is cleaned up but because it is listed as loaded it does not get reloaded.

    In fact reloading would be bad anyways because we want to avoid that which is the whole point of roadrunner.

    it would be great to keep the standard behaviour, but to be 100% correct it should have a totally clean environment to run the unittests in.

    A slow but correct solution would just run the unittests in a seperate process, essentially re-invoking the test runner with just unit test layer enabled.

    A faster but weird smelling solution would be to fork a seperate image of the pre-Plone layer loading testrunner and use that image to run unittests quickly and correctly.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket


Referenced by