Re: [Zope-dev] upload zope.app.exception to pypi
Jan-Wijbrand Kolman <janwijbrand@gmail.com> wrote:
Baiju M <mbaiju@zeomega.com> wrote:
$ ./bin/test /opt/baiju/wa/z3hello/eggs/zope.testing-3.8.6-py2.6.egg/zope/testing/ testrunner/debug.py:23: DeprecationWarning: zope.testing.doctest is deprecated in favour of the Python standard library doctest module from zope.testing import doctest Test-module import failures:
Module: zope.app.exception.browser.tests.test_unauthorized
Traceback (most recent call last): File "/tmp/zope.app.exception/src/zope/app/exception/browser/tests/ test_unauthorized.py", line 20, in <module> import zope.app.pagetemplate.namedtemplate File "/opt/baiju/wa/z3hello/eggs/zope.app.pagetemplate-3.10.0-py2.6.egg/ zope/app/pagetemplate/namedtemplate.py", line 20, in <module> from zope.browerpage.namedtemplate import implementation ImportError: No module named browerpage.namedtemplate
As it turns out, since the "release" of zope.app.exception 3.6.0 namedtemplate has again been moved. It is now in zope.browserpage. However, zope.browserpage is not required yet by zope.app.exception.
This has been fixed now, but now I'm stumped at this error: 16:17 jw:~/project/grokdev/z.a.exception $ ./bin/test /home/jw/project/grokdev/z.a.exception/eggs/zope.testing-3.8.6-py2.5.egg/zope/ testing/testrunner/debug.py:23: DeprecationWarning: zope.testing.doctest is deprecated in favour of the Python standard library doctest module from zope.testing import doctest Running zope.app.exception.testing.AppExceptionLayer tests: Set up zope.app.exception.testing.AppExceptionLayer Traceback (most recent call last): File "/home/jw/project/grokdev/z.a.exception/eggs/zope.testing-3.8.6- py2.5.egg/zope/testing/testrunner/runner.py", line 367, in run_layer setup_layer(options, layer, setup_layers) File "/home/jw/project/grokdev/z.a.exception/eggs/zope.testing-3.8.6- py2.5.egg/zope/testing/testrunner/runner.py", line 632, in setup_layer layer.setUp() File "/home/jw/project/grokdev/z.a.exception/eggs/zope.app.testing-3.7.3- py2.5.egg/zope/app/testing/functional.py", line 337, in setUp self.config_file, product_config=self.product_config) File "/home/jw/project/grokdev/z.a.exception/eggs/zope.app.testing-3.7.3- py2.5.egg/zope/app/testing/functional.py", line 226, in __init__ setup.setUpManager() File "/home/jw/project/grokdev/z.a.exception/eggs/ zope.app.securitypolicy-3.5.1-py2.5.egg/zope/app/securitypolicy/browser/tests/ functional.py", line 26, in setUpManager functional.HTTPCaller()(grant_request, handle_errors=False) File "/home/jw/project/grokdev/z.a.exception/eggs/zope.app.testing-3.7.3- py2.5.egg/zope/app/testing/functional.py", line 743, in __call__ request = publish(request, handle_errors=handle_errors) File "/home/jw/project/grokdev/z.a.exception/eggs/zope.publisher-3.12.0- py2.5.egg/zope/publisher/publish.py", line 131, in publish obj = request.traverse(obj) File "/home/jw/project/grokdev/z.a.exception/eggs/zope.publisher-3.12.0- py2.5.egg/zope/publisher/browser.py", line 556, in traverse ob, add_steps = publication.getDefaultTraversal(self, ob) File "/home/jw/project/grokdev/z.a.exception/eggs/zope.app.publication-3.10.0- py2.5.egg/zope/app/publication/browser.py", line 36, in getDefaultTraversal return ob.browserDefault(request) Unauthorized: (<zope.browserpage.simpleviewclass.SimpleViewClass from /home/jw/ project/grokdev/z.a.exception/eggs/zope.app.securitypolicy-3.5.1-py2.5.egg/zope/ app/securitypolicy/browser/granting.pt object at 0xa6e6f8c>, 'browserDefault', 'zope.Security') I'm trying to figure out what has changed that could be related to this, but if anyone has a hint for me... regards, jw
Hi there, Jan-Wijbrand Kolman wrote:
I'm trying to figure out what has changed that could be related to this, but if anyone has a hint for me...
I can definitely reproduce the error. It seems to be occurring somewhere in the setup of the test layer, but strangely enough the publisher kicks in somewhere. I'm curious why the ZTK tests didn't catch this issue (or now the zopeapp tests). Regards, Martijn
Martijn Faassen wrote:
It seems to be occurring somewhere in the setup of the test layer, but strangely enough the publisher kicks in somewhere. I'm curious why the ZTK tests didn't catch this issue (or now the zopeapp tests).
Hm, the zopeapp tests are catching this today. They weren't catching it last week. I think something broke in the mean time. I'm getting these problems across a lot of zope.app.* packages now, not just zope.app.exception. I updated the ZTK a few times with changes Hanno made to the Zope 2 fork. Perhaps I neglected to run the zopeapp tests. That's not a good sign for the future. Regards, Martijn
Martijn Faassen <faassen@startifact.com> wrote:
Jan-Wijbrand Kolman wrote:
I'm trying to figure out what has changed that could be related to this, but if anyone has a hint for me...
I can definitely reproduce the error.
It seems to be occurring somewhere in the setup of the test layer, but strangely enough the publisher kicks in somewhere. I'm curious why the ZTK tests didn't catch this issue (or now the zopeapp tests).
The publisher kicks in because when the layer is setup, the "mgr" user is granted the necessary permissions. This is done "TTW" using HTTPCaller(). In the request string that is passed to it, the basic auth credentials for "globalmgr:globalmgrpw" are passed in. This however seems not to work (anymore), where, looking at the history of this setup code, it had been working for a very long time. It must be something small and simple I guess, but it is needles and haystacks for me at this point... regards, jw
Jan-Wijbrand Kolman wrote: [snip]
It must be something small and simple I guess, but it is needles and haystacks for me at this point...
Since I could reproduce this failure with zopeapp, it must be a very recent change. From what I can see, zope.container and zope.publisher changed. zope.container appears to be a small change, but zope.publisher 3.12 has a larger refactoring, factoring out zope.login. When I changed the ZTk back to zope.publisher 3.11 things worked again. Then I realized a better solution, which was to make zope.login a test dependency of zope.app.exception. After that its tests worked again. I'll go through the rest of zope.app.* to fix any other related breakages. When we still tested zope.app.* in the ZTK the person making the change would have immediately noticed this problem. But I neglected to run the zopeapp tests when I made the change in ZTK faassen-smaller. Bad me. And nobody else got warned either when making the change to the ZTK, as that ZTK didn't test the zope.app anymore. This reminds me of Jim's notion of an "extended test suite" for the ZTK, though I'm not sure whether that would have helped. Regards, Martijn
participants (2)
-
Jan-Wijbrand Kolman -
Martijn Faassen