Commit 1b1dbf60 authored by Jérome Perrin's avatar Jérome Perrin

tests: also consider python unittest failures in functional tests

It can happen that a test running selenium fail in python, but not in selenium,
like for example test_result_module/20210615-CDADEC14/183
To prevent such tests from being reported as PASS, we make the total number of
failures being the sum of the python unittest failures and the selenium failures.
parent 3fe3ef2c
...@@ -133,20 +133,21 @@ class ERP5(_ERP5): ...@@ -133,20 +133,21 @@ class ERP5(_ERP5):
def _updateFunctionalTestResponse(self, status_dict): def _updateFunctionalTestResponse(self, status_dict):
""" Convert the Unit Test output into more accurate information """ Convert the Unit Test output into more accurate information
related to funcional test run. related to functional test run.
""" """
# Parse relevant information to update response information # Parse relevant information to update response information
try: try:
summary, html_test_result = status_dict['stderr'].split("-"*79)[1:3] summary, html_test_result = status_dict['stderr'].split("-"*79)[1:3]
except ValueError: except ValueError:
# In case of error when parse the file, preserve the original # In case of error when parse the file, preserve the original
# informations. This prevents we have unfinished tests. # information. This prevents we have unfinished tests.
return status_dict return status_dict
status_dict['html_test_result'] = html_test_result status_dict['html_test_result'] = html_test_result
search = self.FTEST_PASS_FAIL_RE.search(summary) search = self.FTEST_PASS_FAIL_RE.search(summary)
if search: if search:
group_dict = search.groupdict() group_dict = search.groupdict()
status_dict['failure_count'] = int(group_dict['failures']) status_dict['failure_count'] = int(group_dict['failures']) \
+ int(status_dict.get('failure_count', 0))
status_dict['test_count'] = int(group_dict['total']) status_dict['test_count'] = int(group_dict['total'])
status_dict['skip_count'] = int(group_dict['expected_failure']) status_dict['skip_count'] = int(group_dict['expected_failure'])
return status_dict return status_dict
......
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