Commit 8d6300da authored by Bryton Lacquement's avatar Bryton Lacquement 🚪 Committed by Julien Muchembled

qa: always report unprocessed activities when functional tests fail

Example for erp5_web_renderjs_ui_test:testFunctionalRJSRelationField, which
was failing randomly (fixed in ca229c3e):

======================================================================
FAIL: testFunctionalTestRunner (erp5.component.test.erp5_version.testFunctionalRJSRelationField.TestRenderJSUIRelationField)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py", line 372, in testFunctionalTestRunner
    self.fail('\n'.join(error))
AssertionError: These messages are pending: [('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/portal_catalog', 'unindexObject', -1, 0), ('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/foo_module', 'immediateReindexObject', -1, 0), ('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/bar_module', 'immediateReindexObject', -1, 0), ('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/foo_bar_module', 'immediateReindexObject', -1, 0), ('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/portal_preferences/erp5_ui_test_preference', 'immediateReindexObject', -1, 0), ('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/foo_module/2', 'immediateReindexObject', -1, 0), ('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/foo_module/2', 'immediateReindexObject', -1, 0), ('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/foo_module/3', 'immediateReindexObject', -1, 0), ('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/foo_module', 'immediateReindexObject', -2, 1), ('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/bar_module', 'immediateReindexObject', -2, 1), ('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/foo_bar_module', 'immediateReindexObject', -2, 1), ('/erp5_portal_faeed2c6ad773e8de11c3b643708ad55/portal_preferences/erp5_ui_test_preference', 'immediateReindexObject', -2, 1)]
Last error message:
RuntimeError
tic is looping forever.
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
    request, bind=1)
  Module ZPublisher.mapply, line 77, in mapply
    if debug is not None: return debug(object,args,context)
  Module ZPublisher.Publish, line 48, in call_object
    result=apply(object,args) # Type s<cr> to step into published object.
  Module Products.ERP5Type.patches.ExternalMethod, line 113, in __call__
    return _f[0](self.aq_parent, *args, **kw)
  Module erp5.component.extension.erp5_version.ERP5Zuite, line 21, in waitForActivities
    raise RuntimeError('tic is looping forever.')
RuntimeError: tic is looping forever.

testAccessUnauthorizedRelationValue
testBreadcrumbCanNotAccessRelationSearchPage
testMultiRelationDefaultSortAndParameterList
testMultiRelationFieldEmptySearchWithListbox
testMultiRelationFieldHomonyms
testMultiRelationFieldSearchWithListbox
testMultiRelationFieldSearchWithProxyListbox
testMultiRelationFieldUnknownIcon
testMultiRelationFieldWithNonSavedPageContent
testProxyListBox
testRelationDefaultSortAndParameterList
testRelationFieldEmptySearchWithListbox
testRelationFieldRefresh
testRelationFieldSearchWithListbox
testRelationFieldWithNonSavedPageContent
testSimpleMultiRelationField

----------------------------------------------------------------------
Ran 1 test in 199.267s
parent bf00e8c3
......@@ -309,14 +309,6 @@ class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
print "TRACEBACK :"
print entry["tb_text"]
def _hasActivityFailure(self):
""" Return True if the portal has any Activity Failure
"""
for m in self.portal.portal_activities.getMessageList():
if m.processing_node < -1:
return True
return False
def testFunctionalTestRunner(self):
# Check the zuite page templates can be rendered, because selenium test
# runner does not report error in case there are errors in the page
......@@ -348,18 +340,15 @@ class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
self.portal._p_jar.sync()
debug = self.foreground or os.environ.get("erp5_debug_mode")
error = None
error = []
try:
iframe = self.runner.test(debug=debug)
except TimeoutError, e:
error = repr(e)
self._verboseErrorLog(20)
else:
# In case of failure, verbose the error_log entries in order to collect
# appropriated information to debug the system.
if self._hasActivityFailure():
error = 'Failed activities exist.'
self._verboseErrorLog(20)
error.append(repr(e))
try:
self.assertNoPendingMessage()
except AssertionError as e:
error.append(str(e))
detail, success, failure, \
expected_failure, error_title_list = self.runner.processResult(iframe)
......@@ -376,10 +365,11 @@ class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
self.logMessage("-" * 79)
self.logMessage(detail)
self.logMessage("-" * 79)
if failure:
if failure or error:
self._verboseErrorLog(20)
self.assertEqual([], error_title_list, '\n'.join(error_title_list))
self.assertEqual(None, error, error)
error += error_title_list
if error:
self.fail('\n'.join(error))
# monkey patch HTTPResponse._unauthorized so that we will not have HTTP
# authentication dialog in case of Unauthorized exception to prevent
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment