plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
246 stars 187 forks source link

Fix plone.app.versioningbehavior test problems #223

Closed tisto closed 6 years ago

tisto commented 10 years ago

plone.app.versioningbehavior is currently excluded from the tests in buildout.coredev 5.0 because some tests fail and the package seems to have test isolation problems. Even though, p.a.versioningbehavior is not officially part of the core, we should test it. Therefore I would suggest to move all tests to use plone.app.testing, making sure we do not have any test isolation problems and re-include the tests into our testing setup.

cc @jone

Test failures in buildout.coredev 5.0:

bin/test -s plone.app.versioningbehavior
Running Products.PloneTestCase.layer.PloneSite tests:
  Set up Testing.ZopeTestCase.layer.ZopeLite in 0.786 seconds.
  Set up Products.PloneTestCase.layer.ZCML in 4.965 seconds.
  Set up Products.PloneTestCase.layer.PloneSite in 4.698 seconds.
  Running:

  Ran 32 tests with 0 failures and 0 errors in 11.605 seconds.
Running plone.app.versioningbehavior.testing.PackageLayer tests:
  Set up collective.testcaselayer.ptc.PTCLayer in 0.030 seconds.
  Set up collective.testcaselayer.mail.MockMailHostLayer in 0.439 seconds.
  Set up collective.testcaselayer.common.CommonPTCLayer in 0.005 seconds.
  Set up plone.app.versioningbehavior.testing.PackageLayer in 0.468 seconds.
  Running:
    3/6 (50.0%)   

Error in test test_versions_history_form_should_work_with_archetypes_content (plone.app.versioningbehavior.tests.test_functional.FunctionalTestCase)
Traceback (most recent call last):
  File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/unittest/case.py", line 331, in run
    testMethod()
  File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/test_functional.py", line 109, in test_versions_history_form_should_work_with_archetypes_content
    self.browser.getControl(label='Title').value = new_title
  File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 371, in getControl
    control, form = disambiguate(intermediate, msg, index)
  File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 48, in disambiguate
    raise LookupError(msg)
LookupError: label 'Title'

    4/6 (66.7%)

Failure in test test_versions_history_form_should_work_with_dexterity_content (plone.app.versioningbehavior.tests.test_functional.FunctionalTestCase)
Traceback (most recent call last):
  File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/unittest/case.py", line 331, in run
    testMethod()
  File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/test_functional.py", line 86, in test_versions_history_form_should_work_with_dexterity_content
    0, self.obj1.getId(), old_title, old_text)
  File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/test_functional.py", line 122, in _assert_versions_history_form
    self.assertIn('Working Copy', self.browser.contents)
  File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/unittest/case.py", line 805, in assertIn
    self.fail(self._formatMessage(msg, standardMsg))
  File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/unittest/case.py", line 412, in fail
    raise self.failureException(msg)
AssertionError: 'Working Copy' not found in '<!DOCTYPE html>\n<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">\n  <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="http://nohost/plone/portal_css/Plone%20Default/++resource++plone.css" media="screen" /><link rel="stylesheet" type="text/css" href="http://nohost/plone/portal_css/Plone%20Default/++resource++plone.app.discussion.stylesheets/discussion.css" media="screen" /><link rel="stylesheet" type="text/css" href="http://nohost/plone/portal_css/Plone%20Default/++resource++plonetheme.barceloneta.css" media="screen" /><link rel="author" href="http://nohost/plone/author/" title="Author information" /><link rel="canonical" href="http://nohost/plone" /><link rel="alternate" href="http://nohost/plone/RSS" title="Plone site - RSS 1.0" type="application/rss+xml" /><link rel="alternate" href="http://nohost/plone/rss.xml" title="Plone site - RSS 2.0" type="application/rss+xml" /><link rel="alternate" href="http://nohost/plone/atom.xml" title="Plone site - Atom" type="application/rss+xml" /><link rel="search" href="http://nohost/plone/@@search" title="Search this site" />\n    <title>Plone site</title>\n\n    <link rel="shortcut icon" type="image/x-icon" href="/plone/++theme++barceloneta/++resource++plonetheme.barceloneta-favicon.ico" />\n    <link rel="apple-touch-icon" href="/plone/++theme++barceloneta/++resource++plonetheme.barceloneta-apple-touch-icon.png" />\n    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/plone/++theme++barceloneta/++resource++plonetheme.barceloneta-apple-touch-icon-144x144-precomposed.png" />\n    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/plone/++theme++barceloneta/++resource++plonetheme.barceloneta-apple-touch-icon-114x114-precomposed.png" />\n    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/plone/++theme++barceloneta/++resource++plonetheme.barceloneta-apple-touch-icon-72x72-precomposed.png" />\n    <link rel="apple-touch-icon-precomposed" sizes="57x57" href="/plone/++theme++barceloneta/++resource++plonetheme.barceloneta-apple-touch-icon-57x57-precomposed.png" />\n    <link rel="apple-touch-icon-precomposed" href="/plone/++theme++barceloneta/++resource++plonetheme.barceloneta-apple-touch-icon-precomposed.png" />\n\n    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->\n    <!--[if lt IE 9]>\n      <script type="text/javascript"\n            src="/plone/++theme++barceloneta/++resource++plonetheme.barceloneta-legacy.js"></script>\n    <![endif]-->\n\n    <script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/++resource++plone.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/plone_javascript_variables.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/++resource++plone.app.jquerytools.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/++resource++plone.app.jquerytools.overlayhelpers.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/++resource++plone.app.jquerytools.form.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/cookie_functions.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/select_all.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/dragdropreorder.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/jquery.highlightsearchterms.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/styleswitcher.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/collapsibleformfields.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/++resource++plone.app.discussion.javascripts/comments.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/dropdown.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/inline_validation.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/kss-bbb.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/table_sorter.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/unlockOnFormUnload.js"></script><script type="text/javascript" src="http://nohost/plone/portal_javascripts/Plone%20Default/++resource++search.js"></script><script type="text/javascript" src="/plone/++theme++barceloneta/++resource++plonetheme.barceloneta.js"></script>\n\n  <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Plone - http://plone.org" /></head>\n\n  <body id="visual-portal-wrapper" class="template-confirm-action portaltype-plone-site site-plone userrole-member userrole-manager userrole-authenticated" dir="ltr" data-pat-tinymce="{&quot;rel_upload_path&quot;: &quot;@@fileUpload&quot;, &quot;relatedItems&quot;: {&quot;vocabularyUrl&quot;: &quot;http://localhost:8080/Plone/@@getVocabulary?name=plone.app.vocabularies.Catalog&quot;}, &quot;folder_url&quot;: &quot;http://nohost/plone&quot;, &quot;linkAttribute&quot;: &quot;UID&quot;, &quot;prependToScalePart&quot;: &quot;/@@images/image/&quot;}" data-pat-modal="{&quot;actionOptions&quot;: {&quot;displayInModal&quot;: false}}" data-base-url="http://nohost/plone">\n      <div class="navbar navbar-fixed-left navbar-inverse" id="edit-zone" role="navigation">\n        <div class="container">\n          <header>\n\n            <div><div class="navbar-header">\n  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">\n    <span class="sr-only">\n      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" version="1.0" id="plone-logo" class="plone-logo" x="0px" y="0px" width="215px" height="26px" viewbox="0 0 56 56" enable-background="new 0 0 56 56">\n      <path d="M28 0C12.537 0 0 12.5 0 28c0.001 15.5 12.5 28 28 28c15.464-0.003 27.998-12.536 28-28 C55.998 12.5 43.5 0 28 0z M43.759 43.759c-4.042 4.038-9.597 6.527-15.76 6.528c-6.164-0.001-11.717-2.492-15.759-6.528 C8.202 39.7 5.7 34.2 5.7 28c0.001-6.163 2.49-11.717 6.528-15.76C16.283 8.2 21.8 5.7 28 5.7 c6.164 0 11.7 2.5 15.8 6.528c4.039 4 6.5 9.6 6.5 15.76C50.286 34.2 47.8 39.7 43.8 43.759z M24.385 9.854c3.346 0 6.1 2.7 6.1 6.059c0 3.347-2.714 6.06-6.06 6.06s-6.059-2.712-6.059-6.06 C18.327 12.6 21 9.9 24.4 9.854z M42.764 28.017c0 3.349-2.711 6.059-6.061 6.059c-3.341 0-6.058-2.711-6.058-6.059 c0-3.348 2.719-6.058 6.058-6.058C40.054 22 42.8 24.7 42.8 28.017z M24.365 34.098c3.347 0 6.1 2.7 6.1 6.1 c0 3.347-2.712 6.06-6.059 6.06c-3.346 0-6.06-2.712-6.06-6.06C18.306 36.8 21 34.1 24.4 34.098z"></path>\n      </svg>\n    </span>\n    <span class="plone-logo">\n     <span class="plone-circle">\n       <span class="plone-circle-inner">\n         <span class="plone-dot-1"></span>\n         <span class="plone-dot-2"></span>\n         <span class="plone-dot-3"></span>\n       </span>\n     </span>\n    </span>\n </button>\n</div>\n\n\n    \n      <div class="contentViewsWrapper">\n          <p class="hiddenStructure">Views</p>\n\n          <ul class="contentViews" id="content-views">\n\n              \n                <li id="contentview-folderContents" class="plain">\n                  <a href="http://nohost/plone/folder_contents?_authenticator=43009e270ae0214058c03842147e1d6677c52d3a?ajax_load=1" class=" pat-modal"><span class="icon-folderContents" aria-hidden="true"></span> <span class="text-toolbar">Contents</span></a>\n                </li>\n              \n              \n                <li id="contentview-view" class="selected">\n                  <a href="http://nohost/plone?_authenticator=43009e270ae0214058c03842147e1d6677c52d3a" class=""><span class="icon-view" aria-hidden="true"></span> <span class="text-toolbar">View</span></a>\n                </li>\n              \n              \n                <li id="contentview-local_roles" class="plain">\n                  <a href="http://nohost/plone/@@sharing?_authenticator=43009e270ae0214058c03842147e1d6677c52d3a?ajax_load=1" class=" pat-modal"><span class="icon-local_roles" aria-hidden="true"></span> <span class="text-toolbar">Sharing</span></a>\n                </li>\n              \n\n          </ul>\n      </div>\n    \n\n\n<div class="contentActions">\n\n</div>\n<div id="portal-personaltools-wrapper">\n\n<p class="hiddenStructure">Personal tools</p>\n\n<ul class="actionMenu deactivated" id="portal-personaltools">\n  \n  <li class="actionMenuHeader dropdown">\n    <a id="user-name" data-toggle="dropdown" href="http://nohost/plone/useractions">\n      <span class="icon-user" aria-hidden="true"></span>\n      <span class="text-toolbar">test_user_1_</span>\n      <span class="caret"></span>\n    </a>\n    <ul class="actionMenuContent dropdown-menu">\n        <li class="dropdown-header">\n          <span>test_user_1_</span>\n        </li>\n        <li id="personaltools-personaltools-preferences">\n            <a href="http://nohost/plone/@@personal-preferences" id="personaltools-preferences" title="Preferences">Preferences</a>\n        </li>\n        <li id="personaltools-personaltools-plone_setup">\n            <a href="http://nohost/plone/@@overview-controlpanel" id="personaltools-plone_setup" title="Site Setup">Site Setup</a>\n        </li>\n        <li id="personaltools-personaltools-logout">\n            <a href="http://nohost/plone/logout" id="personaltools-logout" title="Log out">Log out</a>\n        </li>\n    </ul>\n  </li>\n  \n</ul>\n\n\n\n</div>\n\n<div class="documentByLine" id="plone-document-byline">\n\n  <ul class="actionMenu deactivated">\n    <li class="actionMenuHeader dropdown">\n      <a id="byline" data-toggle="dropdown">\n        <span class="icon-info-circled" aria-hidden="true"></span>\n        <span class="text-toolbar">Content Info</span>\n        <span class="caret"></span>\n      </a>\n      <ul class="actionMenuContent dropdown-menu">\n        <li>\n          <ul>\n            <li class="dropdown-header">\n              \n              <span>Content info</span>\n            </li>\n            <li>\n              \n            </li>\n            <li>\n              \n                \n\n                <span class="documentModified">\n                  <span>last modified</span>\n                  Jun 21, 2014 03:22 PM\n                </span>\n              \n            </li>\n            <li>\n              \n            </li>\n            <li>\n              \n            </li>\n            <li>\n              \n            </li><li>\n            </li><li>\n              \n            </li>\n          </ul>\n            </li>\n        <li>\n          <ul>\n            <li class="dropdown-header"><span>File info</span></li>\n            <li><span>Content name: Name</span></li>\n            <li><span>Short name: /short-name</span></li>\n          </ul>\n        </li>\n        <li>\n          <ul>\n            <li class="dropdown-header"><span>Connected Translations</span></li>\n            <li><span><a>Occitanian</a></span></li>\n            <li><span><a>German</a></span></li>\n          </ul>\n        </li>\n      </ul>\n      \n    </li>\n  </ul>\n\n</div>\n</div>\n          </header>\n        </div>\n      </div>\n    <div class="outer-wrapper">\n      <header id="content-header" role="banner">\n          <div class="container-fluid">\n            \n      <div id="portal-header">\n    <p class="hiddenStructure">\n  <a accesskey="2" href="http://nohost/plone/@@confirm-action?version_id=0&amp;amp;original_url=http://nohost/plone/obj1/versions_history_form#content">Skip to content</a> |\n\n  <a accesskey="6" href="http://nohost/plone/@@confirm-action?version_id=0&amp;amp;original_url=http://nohost/plone/obj1/versions_history_form#portal-globalnav">Skip to navigation</a>\n</p>\n\n<a id="portal-logo" title="Plone site" accesskey="1" href="http://nohost/plone">\n    <img src="http://nohost/plone/logo.png" alt="Plone site" title="Plone site" height="56" width="215" /></a>\n\n<div id="portal-searchbox">\n\n    <form id="searchGadget_form" action="http://nohost/plone/@@search" role="search">\n\n        <div class="LSBox">\n        <label class="hiddenStructure" for="searchGadget">Search Site</label>\n\n        <input name="SearchableText" type="text" size="18" title="Search Site" placeholder="Search Site" accesskey="4" class="searchField" id="searchGadget" />\n\n        <input class="searchButton" type="submit" value="Search" />\n\n        <div class="searchSection">\n            <input id="searchbox_currentfolder_only" class="noborder" type="checkbox" name="path" value="/plone" />\n            <label for="searchbox_currentfolder_only" style="cursor: pointer">only in current section</label>\n        </div>\n\n        <div class="LSResult" id="LSResult"><div class="LSShadow" id="LSShadow"></div></div>\n        </div>\n    </form>\n\n    <div id="portal-advanced-search" class="hiddenStructure">\n        <a href="http://nohost/plone/@@search" accesskey="5">Advanced Search\xe2\x80\xa6</a>\n    </div>\n\n</div>\n\n\n\n</div>\n\n    \n            <div id="anonymous-actions">\n            </div>\n          </div>\n      </header>\n      <div class="row" id="mainnavigation-wrapper">\n        <div class="container-fluid" id="mainnavigation">\n    <p class="hiddenStructure">Navigation</p>\n    <nav class="navbar" id="portal-globalnav-wrapper" role="navigation">\n\n        <div class="navbar-header">\n          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#portal-globalnav-collapse">\n            <span class="sr-only">Toggle navigation</span>\n            <span class="icon-bar"></span>\n            <span class="icon-bar"></span>\n            <span class="icon-bar"></span>\n          </button>\n        </div>\n\n        <div class="collapse navbar-collapse" id="portal-globalnav-collapse">\n          <ul class="nav navbar-nav" id="portal-globalnav">\n              \n                <li id="portaltab-index_html" class="selected">\n                    <a href="http://nohost/plone" title="">Home</a>\n                </li>\n              \n              \n                <li id="portaltab-news" class="plain">\n                    <a href="http://nohost/plone/news" title="Site News">News</a>\n                </li>\n              \n              \n                <li id="portaltab-events" class="plain">\n                    <a href="http://nohost/plone/events" title="Site Events">Events</a>\n                </li>\n              \n              \n                <li id="portaltab-Members" class="plain">\n                    <a href="http://nohost/plone/Members" title="Site Users">Users</a>\n                </li>\n              \n              \n                <li id="portaltab-obj1" class="plain">\n                    <a href="http://nohost/plone/obj1" title="Description of obect number 1">My special new title for object 1</a>\n                </li>\n              \n          </ul>\n        </div>\n    </nav>\n\n</div>\n      </div>\n      \n      <div class="row" id="above-content-wrapper">\n          <section id="viewlet-above-content"><nav id="portal-breadcrumbs" class="breadcrumb" role="navigation">\n  <div class="container-fluid">\n\n      <span id="breadcrumbs-you-are-here">You are here:</span>\n      <ol aria-labelledby="breadcrumbs-you-are-here">\n        <li id="breadcrumbs-home">\n          <a href="http://nohost/plone">Home</a>\n        </li>\n        \n      </ol>\n  </div>\n</nav>\n</section>\n      </div>\n      <div class="container-fluid">\n        <div class="row">\n          <aside id="global_statusmessage">\n      \n\n      <div>\n      </div>\n    </aside>\n        </div>\n\n        <div id="main-container" class="row row-offcanvas row-offcanvas-right">\n          <div id="column1-container">\n          </div>\n          \n      <div class="col-xs-12 col-sm-12">\n          <p class="pull-right visible-xs">\n            <button type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas">Toggle nav</button>\n          </p>\n          <div class="row">\n            <div class="col-xs-12 col-sm-12" role="main">\n               <div id="content">\n\n          \n\n          <header>\n            <div id="viewlet-above-content-title"></div>\n            \n                <h1 class="documentFirstHeading">Plone site</h1>\n            \n            <div id="viewlet-below-content-title"></div>\n\n            \n                \n            \n          </header>\n\n          <section id="viewlet-above-content-body"></section>\n          <section id="content-core">\n            \n    \n      <p class="discreet">\n        Careful, it\'s possible someone is executing an exploit against you.\n        Verify you just performed an action on this site and that you were\n        not referred here by a different website or email.\n      </p>\n      <form method="GET" action="http://nohost/plone/obj1/versions_history_form">\n        \n          <input type="hidden" name="version_id" value="0" />\n        \n        \n          <input type="hidden" name="original_url" value="http://nohost/plone/obj1/versions_history_form" />\n        \n        <dl>\n          <dt>Original URL</dt>\n          <dd>http://nohost/plone/obj1/versions_history_form</dd>\n        </dl>\n        <div class="formControls">\n          <input type="submit" value="Confirm action" name="form.button.confirm" class="standalone" />\n        </div>\n      <input name="_authenticator" type="hidden" value="b48598d3bad6d7da744c4d280d1ab627c93e1526" /></form>\n    \n  \n          </section>\n          <section id="viewlet-below-content-body">\n\n    <div class="visualClear"><!-- --></div>\n\n    <div class="documentActions">\n        \n\n        \n\n    </div>\n\n</section>\n\n          \n        </div>\n            </div>\n          </div>\n          <footer class="row">\n            <div class="col-xs-12 col-sm-12">\n             <div id="viewlet-below-content">\n</div>\n            </div>\n          </footer>\n      </div><!--/row-->\n  \n          <div id="column2-container">\n          </div>\n        </div><!--/row-->\n\n      </div><!--/.container-->\n    </div><!-- outer-wrapper --><footer id="portal-footer-wrapper" role="contentinfo">\n      <div class="container-fluid" id="portal-footer">\n      \n<div class="portletWrapper" id="portletwrapper-706c6f6e652e666f6f746572706f72746c6574730a636f6e746578740a2f706c6f6e650a666f6f746572" data-portlethash="706c6f6e652e666f6f746572706f72746c6574730a636f6e746578740a2f706c6f6e650a666f6f746572">\n\n\n  \n\n  \n    \n\n  <section class="portlet portletClassic" id="portal-footer-signature">\n    <div class="portletContent">\n      The \n           <a href="http://plone.org">Plone<sup>\xc2\xae</sup> Open Source CMS/WCM</a>\n       is <abbr title="Copyright">\xc2\xa9</abbr> 2000-2014 by the \n           <a href="http://plone.org/foundation">Plone Foundation</a> and friends.\n\n      Distributed under the \n                <a href="http://creativecommons.org/licenses/GPL/2.0/">GNU GPL license</a>.\n    </div>\n  </section>\n\n\n  \n\n</div>\n\n\n<div class="portletWrapper" id="portletwrapper-706c6f6e652e666f6f746572706f72746c6574730a636f6e746578740a2f706c6f6e650a616374696f6e73" data-portlethash="706c6f6e652e666f6f746572706f72746c6574730a636f6e746578740a2f706c6f6e650a616374696f6e73">\n\n<section class="portlet portletActions">\n\n  \n\n  <ul class="portletContent">\n    \n      <li class="portletItem">\n        <a href="http://nohost/plone/sitemap">\n\n          <span>Site Map</span>\n\n          \n\n        </a>\n      </li>\n    \n    \n      <li class="portletItem">\n        <a href="http://nohost/plone/accessibility-info">\n\n          <span>Accessibility</span>\n\n          \n\n        </a>\n      </li>\n    \n    \n      <li class="portletItem">\n        <a href="http://nohost/plone/contact-info" class="pat-modal" data-pat-modal="{}">\n\n          <span>Contact</span>\n\n          \n\n        </a>\n      </li>\n    \n  </ul>\n\n</section>\n\n</div>\n\n\n<div class="portletWrapper" id="portletwrapper-706c6f6e652e666f6f746572706f72746c6574730a636f6e746578740a2f706c6f6e650a636f6c6f70686f6e" data-portlethash="706c6f6e652e666f6f746572706f72746c6574730a636f6e746578740a2f706c6f6e650a636f6c6f70686f6e">\n\n\n  \n\n  \n    \n\n  <section class="portlet portletClassic" id="portal-colophon">\n    <div class="portletContent">\n      <a href="http://plone.org" target="_blank" title="This site was built using the Plone Open Source CMS/WCM.">Powered by Plone &amp; Python</a>\n    </div>\n  </section>\n\n\n  \n\n</div>\n\n\n\n\n    </div>\n    </footer></body>\n</html>'

    6/6 (100.0%)

Failure in test /Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt
Traceback (most recent call last):
  File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/unittest/case.py", line 331, in run
    testMethod()
  File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for doctest_behavior.txt
  File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt", line 0

----------------------------------------------------------------------
File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt", line 130, in doctest_behavior.txt
Failed example:
    browser.getControl(name='paths:list').displayValue = ['Blubb2']
Exception raised:
    Traceback (most recent call last):
      File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest doctest_behavior.txt[53]>", line 1, in <module>
        browser.getControl(name='paths:list').displayValue = ['Blubb2']
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 371, in getControl
        control, form = disambiguate(intermediate, msg, index)
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 48, in disambiguate
        raise LookupError(msg)
    LookupError: name 'paths:list'
----------------------------------------------------------------------
File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt", line 131, in doctest_behavior.txt
Failed example:
    browser.getControl(name='folder_copy:method').click()
Exception raised:
    Traceback (most recent call last):
      File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest doctest_behavior.txt[54]>", line 1, in <module>
        browser.getControl(name='folder_copy:method').click()
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 371, in getControl
        control, form = disambiguate(intermediate, msg, index)
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 48, in disambiguate
        raise LookupError(msg)
    LookupError: name 'folder_copy:method'
----------------------------------------------------------------------
File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt", line 132, in doctest_behavior.txt
Failed example:
    browser.getControl(name='folder_paste:method').click()
Exception raised:
    Traceback (most recent call last):
      File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest doctest_behavior.txt[55]>", line 1, in <module>
        browser.getControl(name='folder_paste:method').click()
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 371, in getControl
        control, form = disambiguate(intermediate, msg, index)
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 48, in disambiguate
        raise LookupError(msg)
    LookupError: name 'folder_paste:method'
----------------------------------------------------------------------
File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt", line 133, in doctest_behavior.txt
Failed example:
    'copy_of_testingtype' in self.portal.objectIds()
Differences (ndiff with -expected +actual):
    - True
    + False
----------------------------------------------------------------------
File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt", line 139, in doctest_behavior.txt
Failed example:
    browser.open('http://nohost/plone/copy_of_testingtype/edit')
Exception raised:
    Traceback (most recent call last):
      File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest doctest_behavior.txt[57]>", line 1, in <module>
        browser.open('http://nohost/plone/copy_of_testingtype/edit')
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 240, in open
        self.mech_browser.open(url, data)
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_mechanize.py", line 203, in open
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_mechanize.py", line 230, in _mech_open
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_opener.py", line 193, in open
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_urllib2_fork.py", line 344, in _open
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_urllib2_fork.py", line 332, in _call_chain
      File "/Users/timo/.buildout/eggs/Zope2-2.13.22-py2.7.egg/Testing/testbrowser.py", line 83, in http_open
        return self.do_open(PublisherConnection, req)
      File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/urllib2.py", line 1181, in do_open
        h.request(req.get_method(), req.get_selector(), req.data, headers)
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/testing.py", line 76, in request
        self.response = self.caller(request_string, handle_errors)
      File "/Users/timo/.buildout/eggs/Zope2-2.13.22-py2.7.egg/Testing/ZopeTestCase/functional.py", line 38, in wrapped_func
        return func(*args, **kw)
      File "/Users/timo/.buildout/eggs/Zope2-2.13.22-py2.7.egg/Testing/ZopeTestCase/zopedoctest/functional.py", line 186, in http
        debug=not handle_errors,
      File "/Users/timo/.buildout/eggs/Zope2-2.13.22-py2.7.egg/ZPublisher/Publish.py", line 455, in publish_module
        environ, debug, request, response)
      File "/Users/timo/.buildout/eggs/Zope2-2.13.22-py2.7.egg/ZPublisher/Publish.py", line 249, in publish_module_standard
        response = publish(request, module_name, after_list, debug=debug)
      File "/Users/timo/.buildout/eggs/Zope2-2.13.22-py2.7.egg/ZPublisher/Publish.py", line 127, in publish
        object=request.traverse(path, validated_hook=validated_hook)
      File "/Users/timo/.buildout/eggs/Zope2-2.13.22-py2.7.egg/ZPublisher/BaseRequest.py", line 519, in traverse
        return response.notFoundError(URL)
      File "/Users/timo/.buildout/eggs/Zope2-2.13.22-py2.7.egg/ZPublisher/HTTPResponse.py", line 718, in notFoundError
        "<p><b>Resource:</b> %s</p>" % escape(entry))
    NotFound:   <h2>Site Error</h2>
      <p>An error was encountered while publishing this resource.
      </p>
      <p><strong>Resource not found</strong></p>

      Sorry, the requested resource does not exist.<p>Check the URL and try again.</p><p><b>Resource:</b> http://nohost/plone/copy_of_testingtype</p>
      <hr noshade="noshade"/>

      <p>Troubleshooting Suggestions</p>

      <ul>
      <li>The URL may be incorrect.</li>
      <li>The parameters passed to this resource may be incorrect.</li>
      <li>A resource that this resource relies on may be
          encountering an error.</li>
      </ul>

      <p>For more detailed information about the error, please
      refer to the error log.
      </p>

      <p>If the error persists please contact the site maintainer.
      Thank you for your patience.
      </p>
----------------------------------------------------------------------
File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt", line 140, in doctest_behavior.txt
Failed example:
    browser.getControl('Title').value = 'Dup'
Exception raised:
    Traceback (most recent call last):
      File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest doctest_behavior.txt[58]>", line 1, in <module>
        browser.getControl('Title').value = 'Dup'
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 370, in getControl
        label, name, self.mech_browser.forms(), include_subcontrols=True)
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_mechanize.py", line 418, in forms
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_mechanize.py", line 443, in viewing_html
    BrowserStateError: not viewing any document
----------------------------------------------------------------------
File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt", line 141, in doctest_behavior.txt
Failed example:
    field = browser.getControl(name='form.widgets.IVersionable.changeNote')
Exception raised:
    Traceback (most recent call last):
      File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest doctest_behavior.txt[59]>", line 1, in <module>
        field = browser.getControl(name='form.widgets.IVersionable.changeNote')
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 370, in getControl
        label, name, self.mech_browser.forms(), include_subcontrols=True)
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_mechanize.py", line 418, in forms
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_mechanize.py", line 443, in viewing_html
    BrowserStateError: not viewing any document
----------------------------------------------------------------------
File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt", line 142, in doctest_behavior.txt
Failed example:
    field.value = 'Edited the duplicate'
Exception raised:
    Traceback (most recent call last):
      File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest doctest_behavior.txt[60]>", line 1, in <module>
        field.value = 'Edited the duplicate'
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 97, in __setattr__
        object.__setattr__(self, name, value)
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 527, in fset
        raise zope.testbrowser.interfaces.ExpiredError
    ExpiredError
----------------------------------------------------------------------
File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt", line 143, in doctest_behavior.txt
Failed example:
    browser.getControl(name='form.buttons.save').click()
Exception raised:
    Traceback (most recent call last):
      File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest doctest_behavior.txt[61]>", line 1, in <module>
        browser.getControl(name='form.buttons.save').click()
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 370, in getControl
        label, name, self.mech_browser.forms(), include_subcontrols=True)
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_mechanize.py", line 418, in forms
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_mechanize.py", line 443, in viewing_html
    BrowserStateError: not viewing any document
----------------------------------------------------------------------
File "/Users/timo/workspace/plone/buildout.coredev-5.0/src/plone.app.versioningbehavior/plone/app/versioningbehavior/tests/doctest_behavior.txt", line 144, in doctest_behavior.txt
Failed example:
    browser.url
Exception raised:
    Traceback (most recent call last):
      File "/Users/timo/workspace/buildout.python/parts/opt/lib/python2.7/doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest doctest_behavior.txt[62]>", line 1, in <module>
        browser.url
      File "/Users/timo/.buildout/eggs/zope.testbrowser-3.11.1-py2.7.egg/zope/testbrowser/browser.py", line 177, in url
        return self.mech_browser.geturl()
      File "build/bdist.macosx-10.9-intel/egg/mechanize/_mechanize.py", line 334, in geturl
    BrowserStateError: not viewing any document

  Ran 6 tests with 2 failures and 1 errors in 20.821 seconds.
Tearing down left over layers:
  Tear down plone.app.versioningbehavior.testing.PackageLayer in 0.000 seconds.
  Tear down collective.testcaselayer.common.CommonPTCLayer in 0.000 seconds.
  Tear down collective.testcaselayer.mail.MockMailHostLayer in 0.000 seconds.
  Tear down collective.testcaselayer.ptc.PTCLayer in 0.000 seconds.
  Tear down Products.PloneTestCase.layer.PloneSite in 0.090 seconds.
  Tear down Products.PloneTestCase.layer.ZCML in 0.009 seconds.
  Tear down Testing.ZopeTestCase.layer.ZopeLite in 0.000 seconds.
Total: 38 tests, 2 failures, 1 errors in 44.520 seconds.
jone commented 10 years ago

Ohh, those tests.. We need to rewrite them, but there are also tests which extend the CMFEditions tests (test_IntegrationTests.py), which are still PloneTestCase tests :unamused:

jone commented 10 years ago

@tisto I've made a pull request which fixes the failing tests (plone/plone.app.versioningbehavior/pull/7). You mentioned testing isolation problems, what are the indications for those?

tisto commented 10 years ago

Thanks! Will give it a try as soon as the Plone 5 build is green again.

tisto commented 10 years ago

Update: Pull request has been merged. Putting p.a.versioningbehavior into the PloneTestCase alltests groups leads to test failures in plone.outputfilters. We can at least run the p.a.versioningbehavior tests now. Tests still needs to be migrated to plone.app.testing...

tisto commented 10 years ago

@jone Adding p.a.versioningbehavior to the plone_app_testing alltests group leads to 30 test failures in plone.caching and plone.app.caching:

Error in test test_contenttype_class_lookup_browser_view (plone.app.caching.tests.test_lookup.TestContentItemLookup)
Traceback (most recent call last):
  File "/Users/timo/.buildout/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 340, in run
    testMethod()
  File "/Users/timo/.buildout/eggs/plone.app.caching-1.2.1-py2.7.egg/plone/app/caching/tests/test_lookup.py", line 151, in test_contenttype_class_lookup_browser_view
    z3c.caching.registry.register(DummyContent, 'rule1')
  File "/Users/timo/.buildout/eggs/z3c.caching-2.0a1-py2.7.egg/z3c/caching/registry.py", line 144, in register
    return registry.register(obj, rule)
  File "/Users/timo/.buildout/eggs/z3c.caching-2.0a1-py2.7.egg/z3c/caching/registry.py", line 64, in register
    raise LookupError("Explicit mode set and ruleset %s not found" % rule)
LookupError: Explicit mode set and ruleset rule1 not found

Any idea how this could be related? There is always the possibility that plone.caching and plone.app.caching have test isolation issues.

jone commented 10 years ago

@tisto I'm currently on vacation for another week, I'll probably not be able to look in into it before. It's probably another isolation problem, probably caches which are not invalidated..

tisto commented 10 years ago

@jone No problem. Enjoy your vacation!

jone commented 10 years ago

I've taken a look at the problem and have these insights: Because the versioningbehavior was added to this test group, which adds PloneTestCase tests, the testing order is changed. This "triggers" a testing isolation problem in the caching tests.

The isolation problem is described and fixed for plone.caching in plone/plone.caching/pull/1 and fixed for plone.app.caching in plone/plone.app.caching/pull/9. No changes in plone.app.versioningbehavior are required since this not really a problem there but only triggered because of the different test order when adding the versioningbehavior to the testing group.

tisto commented 10 years ago

Thanks @jone for figuring that out! I will look into it...

tisto commented 10 years ago

@jone Thank you so much for working on that! Your pull requests fixed quite a few issues. I owe you a beer or two at Ploneconf. :)

Both pull requests have been merged.

Though, putting p.a.versioningbehavior into the plone_app_testing group seems to cause strange and flickering test failures (e.g. ImportError: No module named CMFEditions.interfaces.IArchivist) in the other test groups (they run fully isolated in a separate "bin/test" process, so I have no idea how this happens):

http://jenkins.plone.org/job/plone-5.0-python-2.7/2805/consoleFull

Any ideas?

jone commented 10 years ago

@tisto you're welcome :wink:

I see two possible sources for the import problems:

  1. the CMFEditions egg was corrupt (is there a egg cache used on jenkins?) or
  2. there are cyclic imports which now occur because of a different import order

I've checked out and run the commit locally (https://github.com/plone/buildout.coredev/commit/3ec2ea5f5b8b5f0d163f315a9a901afe14e2805 with ./bin/buildout -c jenkins.cfg && bin/jenkins-alltests --all) and it mostly passed (I've only had some robot errors because of timeouts, which are not relevant for this problem).

Did the build run multiple times? Can we run it again for checking wether it was only a temporary error? It's a little hard to debug when I'm not able to reproduce it locally :confused:

tisto commented 10 years ago

@jone I had to completely remove plone.app.linkintegrity from auto-checkout because it broke the build quite regularly. See

http://jenkins.plone.org/job/plone-5.0-python-2.7/2820/consoleFull

for the latest failure.

We use a buildout cache and I removed P.CMFEditions from all slave caches.

Let me know if there is anything I can do to assist you. I could give you access to jenkins.plone.org so you can re-add the package and trigger builds yourself if you want.

jone commented 10 years ago

@tisto I've tried to reproduce the problem locally (Mac OS) as well as on our company CI (Linux) but failed. It seems that it only occurs on the Plone Jenkins servers. Is there a VM I could clone for debugging? Otherwise I think I'd need ssh access for debugging.

tisto commented 10 years ago

We are working on a vagrant image and a ansible playbook to set up the exact configuration that jenkins.plone.org uses. I hope we can finish that by the end of the week. I will get back to you...

tomgross commented 8 years ago

Is this still an issue?

jensens commented 6 years ago

I close this one. First, the plone.app.versioningbehavior problem itself was solved. Second, I am sure any of those problems of other packages will be addressed with the Python 3 transition process.

If there are problems left and they were not solved in the python3 branches, please create fresh issues.