Commit 022243f6 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

support svn trunk Zelenium.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25414 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1cc57ebe
...@@ -231,12 +231,11 @@ def sendResult(): ...@@ -231,12 +231,11 @@ def sendResult():
file_content = urllib2.urlopen(result_uri).read() file_content = urllib2.urlopen(result_uri).read()
passes_re = re.compile('<th[^>]*>Tests passed</th>\n\s*<td[^>]*>([^<]*)') passes_re = re.compile('<th[^>]*>Tests passed</th>\n\s*<td[^>]*>([^<]*)')
failures_re = re.compile('<th[^>]*>Tests failed</th>\n\s*<td[^>]*>([^<]*)') failures_re = re.compile('<th[^>]*>Tests failed</th>\n\s*<td[^>]*>([^<]*)')
check_re = re.compile('<img[^>]*?/check.gif"\s*[^>]*?>') image_re = re.compile('<img[^>]*?>')
error_re = re.compile('<img[^>]*?/error.gif"\s*[^>]*?>') error_title_re = re.compile('(?:error.gif.*?>|title status_failed"><td[^>]*>)([^>]*?)</td></tr>', re.S)
error_title_re = re.compile('error.gif.*?>([^>]*?)</td></tr>', re.S) result_re = re.compile('<div style="padding-top: 10px;">\s*<p>\s*'
pass_test_re = re.compile('<div style="padding-top: 10px;">\s*<p>\s*' '<img.*?</div>\s.*?</div>\s*', re.S)
'<img[^>]*?/check.gif".*?</div>\s.*?</div>\s*', re.S) error_result_re = re.compile('.*(?:error.gif|title status_failed).*', re.S)
footer_re = re.compile('<h2> Remote Client Data </h2>.*</table>', re.S)
passes = passes_re.search(file_content).group(1) passes = passes_re.search(file_content).group(1)
failures = failures_re.search(file_content).group(1) failures = failures_re.search(file_content).group(1)
...@@ -256,18 +255,19 @@ Tests failed: %4s ...@@ -256,18 +255,19 @@ Tests failed: %4s
Following tests failed: Following tests failed:
%s""" % (passes, failures, "\n".join(error_titles)) %s""" % (passes, failures, "\n".join(error_titles))
file_content = pass_test_re.sub('', file_content) detail = ''
file_content = footer_re.sub('', file_content) for e in result_re.findall(file_content):
file_content = check_re.sub( if error_result_re.match(e):
'<span style="color: green">PASS</span>', file_content) detail += e
file_content = error_re.sub( detail = image_re.sub('', detail)
'<span style="color: red">FAIL</span>', file_content) if detail:
detail = '<html><body>%s</body></html>' % detail
status = (not failures) status = (not failures)
if send_mail: if send_mail:
sendMail(subject=subject, sendMail(subject=subject,
body=summary, body=summary,
status=status, status=status,
attachments=[file_content], attachments=[detail],
from_mail='nobody@svn.erp5.org', from_mail='nobody@svn.erp5.org',
to_mail=[email_to_address]) to_mail=[email_to_address])
if stdout: if stdout:
...@@ -276,7 +276,7 @@ Following tests failed: ...@@ -276,7 +276,7 @@ Following tests failed:
print '-' * 79 print '-' * 79
print summary print summary
print '-' * 79 print '-' * 79
print file_content print detail
return int(failures) return int(failures)
if __name__ == "__main__": if __name__ == "__main__":
......
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