Functional tests broken on master

Bug #1387351 reported by Tres Seaver
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Critical
Tres Seaver

Bug Description

See Travis:

- Python 2.6: https://travis-ci.org/zopefoundation/Zope/jobs/39420844
- Python 2.7: https://travis-ci.org/zopefoundation/Zope/jobs/39420845

When run from the buildout::

    $ bin/test --all
    /home/tseaver/projects/Zope/Z2/trunk/eggs/RestrictedPython-3.6.0-py2.7.egg/RestrictedPython/SelectCompiler.py:17: DeprecationWarning: The compiler package is deprecated and removed in Python 3.x.
    import compiler
    Running OFS.tests.testCopySupportEvents.EventLayer tests:
    Set up OFS.tests.testCopySupportEvents.EventLayer in 0.059 seconds.
    Ran 14 tests with 0 failures, 0 errors and 0 skipped in 0.027 seconds.
    Running OFS.tests.testCopySupportHooks.HookLayer tests:
    Tear down OFS.tests.testCopySupportEvents.EventLayer in 0.000 seconds.
    Set up OFS.tests.testCopySupportHooks.HookLayer in 0.059 seconds.
    Ran 14 tests with 0 failures, 0 errors and 0 skipped in 0.029 seconds.
    Running Testing.ZopeTestCase.layer.ZopeLite tests:
    Tear down OFS.tests.testCopySupportHooks.HookLayer in 0.000 seconds.
    Set up Testing.ZopeTestCase.layer.ZopeLite in 0.000 seconds.

    Failure in test testChangeTitle (Testing.ZopeTestCase.testFunctional.TestFunctional)
    Traceback (most recent call last):
    File "/opt/Python-2.7.6/lib/python2.7/unittest/case.py", line 331, in run
        testMethod()
    File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/testFunctional.py", line 97, in testChangeTitle
        self.assertEqual(response.getStatus(), 200)
    File "/opt/Python-2.7.6/lib/python2.7/unittest/case.py", line 515, in assertEqual
        assertion_func(first, second, msg=msg)
    File "/opt/Python-2.7.6/lib/python2.7/unittest/case.py", line 508, in _baseAssertEqual
        raise self.failureException(msg)
    AssertionError: 503 != 200

    Failure in test testPOST (Testing.ZopeTestCase.testFunctional.TestFunctional)
    Traceback (most recent call last):
    File "/opt/Python-2.7.6/lib/python2.7/unittest/case.py", line 331, in run
        testMethod()
    File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/testFunctional.py", line 111, in testPOST
        self.assertEqual(response.getStatus(), 200)
    File "/opt/Python-2.7.6/lib/python2.7/unittest/case.py", line 515, in assertEqual
        assertion_func(first, second, msg=msg)
    File "/opt/Python-2.7.6/lib/python2.7/unittest/case.py", line 508, in _baseAssertEqual
        raise self.failureException(msg)
    AssertionError: 503 != 200

    Failure in test /home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt
    Failed doctest test for FunctionalDocTest.txt
    File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt", line 0

    ----------------------------------------------------------------------
    File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt", line 108, in FunctionalDocTest.txt
    Failed example:
        print http(r"""
        GET /test_folder_1_/index_html/change_title?title=Foo HTTP/1.1
        Authorization: Basic %s
        """ % user_auth, handle_errors=False)
    Exception raised:
        Traceback (most recent call last):
        File "/opt/Python-2.7.6/lib/python2.7/doctest.py", line 1289, in __run
            compileflags, 1) in test.globs
        File "<doctest FunctionalDocTest.txt[6]>", line 4, in <module>
            """ % user_auth, handle_errors=False)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/functional.py", line 38, in wrapped_func
            return func(*args, **kw)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/zopedoctest/functional.py", line 186, in http
            debug=not handle_errors,
        File "/home/tseaver/projects/Zope/Z2/trunk/src/ZPublisher/Publish.py", line 464, in publish_module
            environ, debug, request, response)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/ZPublisher/Publish.py", line 258, in publish_module_standard
            response = publish(request, module_name, after_list, debug=debug)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/ZPublisher/Publish.py", line 147, in publish
            request, bind=1)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/ZPublisher/mapply.py", line 77, in mapply
            if debug is not None: return debug(object,args,context)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/ZPublisher/Publish.py", line 54, in call_object
            result=apply(object,args) # Type s<cr> to step into published object.
        File "/home/tseaver/projects/Zope/Z2/trunk/src/OFS/DTMLMethod.py", line 135, in __call__
            r = apply(HTML.__call__, (self, client, REQUEST), kw)
        - /test_folder_1_/change_title/manage_main
        - Physical Path: /test_folder_1_/change_title
        File "/home/tseaver/projects/Zope/Z2/trunk/eggs/DocumentTemplate-2.13.2-py2.7-linux-x86_64.egg/DocumentTemplate/DT_String.py", line 477, in __call__
            try: result = render_blocks(self._v_blocks, md)
        File "/home/tseaver/projects/Zope/Z2/trunk/eggs/DocumentTemplate-2.13.2-py2.7-linux-x86_64.egg/DocumentTemplate/DT_Util.py", line 210, in eval
            return eval(code, d)
        - __traceback_info__: REQUEST
        File "<string>", line 1, in <expression>
        NameError: name 'manage_changeProperties' is not defined
    ----------------------------------------------------------------------
    File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt", line 116, in FunctionalDocTest.txt
    Failed example:
        self.folder.index_html.title_or_id()
    Differences (ndiff with -expected +actual):
        - 'Foo'
        + 'index_html'
    ----------------------------------------------------------------------
    File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt", line 122, in FunctionalDocTest.txt
    Failed example:
        print http(r"""
        GET /test_folder_1_/index_html/change_title?title=Baz HTTP/1.1
        Authorization: Basic %s:%s
        """ % (user_name, user_password), handle_errors=False)
    Exception raised:
        Traceback (most recent call last):
        File "/opt/Python-2.7.6/lib/python2.7/doctest.py", line 1289, in __run
            compileflags, 1) in test.globs
        File "<doctest FunctionalDocTest.txt[9]>", line 4, in <module>
            """ % (user_name, user_password), handle_errors=False)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/functional.py", line 38, in wrapped_func
            return func(*args, **kw)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/zopedoctest/functional.py", line 186, in http
            debug=not handle_errors,
        File "/home/tseaver/projects/Zope/Z2/trunk/src/ZPublisher/Publish.py", line 464, in publish_module
            environ, debug, request, response)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/ZPublisher/Publish.py", line 258, in publish_module_standard
            response = publish(request, module_name, after_list, debug=debug)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/ZPublisher/Publish.py", line 147, in publish
            request, bind=1)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/ZPublisher/mapply.py", line 77, in mapply
            if debug is not None: return debug(object,args,context)
        File "/home/tseaver/projects/Zope/Z2/trunk/src/ZPublisher/Publish.py", line 54, in call_object
            result=apply(object,args) # Type s<cr> to step into published object.
        File "/home/tseaver/projects/Zope/Z2/trunk/src/OFS/DTMLMethod.py", line 135, in __call__
            r = apply(HTML.__call__, (self, client, REQUEST), kw)
        - /test_folder_1_/change_title/manage_main
        - Physical Path: /test_folder_1_/change_title
        File "/home/tseaver/projects/Zope/Z2/trunk/eggs/DocumentTemplate-2.13.2-py2.7-linux-x86_64.egg/DocumentTemplate/DT_String.py", line 477, in __call__
            try: result = render_blocks(self._v_blocks, md)
        File "/home/tseaver/projects/Zope/Z2/trunk/eggs/DocumentTemplate-2.13.2-py2.7-linux-x86_64.egg/DocumentTemplate/DT_Util.py", line 210, in eval
            return eval(code, d)
        - __traceback_info__: REQUEST
        File "<string>", line 1, in <expression>
        NameError: name 'manage_changeProperties' is not defined
    ----------------------------------------------------------------------
    File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt", line 130, in FunctionalDocTest.txt
    Failed example:
        self.folder.index_html.title_or_id()
    Differences (ndiff with -expected +actual):
        - 'Baz'
        + 'index_html'
    ----------------------------------------------------------------------
    File "/home/tseaver/projects/Zope/Z2/trunk/src/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt", line 135, in FunctionalDocTest.txt
    Failed example:
        print http(r"""
        GET /test_folder_1_/index_html/set_cookie HTTP/1.1
        """, handle_errors=False)
    Differences (ndiff with -expected +actual):
        HTTP/1.1 200 OK
        Content-Length: 0
        - ...
        Set-Cookie: cookie_test="OK"
        <BLANKLINE>

These all appear to be failures trying to use DTMLMethods in functests to
manipulate properties, etc., but the bindings are not set up correctly
(the "context" / "self" object is missing or None).

Tres Seaver (tseaver)
Changed in zope2:
importance: High → Critical
Revision history for this message
Tres Seaver (tseaver) wrote :

Should be fixed by https://github.com/zopefoundation/Zope/commit/12042f18b6d59ded2ae0ce2e2bac7a7c009acd2e:

    Fix DTML bindings to work with 'zope.publisher' 4.x.

    'zope.publisher.publish.unwrapMethod' was not recognizing the faux-callable
    nature of DTMLMethod. Add a '__code__' attr to help it find us.

    Neaten / normalize functest scaffolding.

Travis is now passing: https://travis-ci.org/zopefoundation/Zope/builds/39431115

Changed in zope2:
status: Confirmed → Fix Committed
Tres Seaver (tseaver)
Changed in zope2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.