Commit 25fe36f7 authored by Romain Courteaud's avatar Romain Courteaud

[HARDCODED] Report Zelenium errors to the distribution tool

parent b71beea0
...@@ -156,7 +156,7 @@ mode = 755 ...@@ -156,7 +156,7 @@ mode = 755
[template-run-zelenium] [template-run-zelenium]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template/run-zelenium-test.py.in url = ${:_profile_base_location_}/template/run-zelenium-test.py.in
md5sum = b78c7f5db0e9c9de9b96ac600da675a6 md5sum = ab554dc5e57b8002e51b0f86074311a3
output = ${buildout:directory}/run-zelenium-test.py.in output = ${buildout:directory}/run-zelenium-test.py.in
mode = 755 mode = 755
......
...@@ -105,6 +105,7 @@ def main(): ...@@ -105,6 +105,7 @@ def main():
# Wait until all bt5 are installed... # Wait until all bt5 are installed...
time.sleep(120) time.sleep(120)
tool = taskdistribution.TaskDistributionTool(portal_url=args.master_url)
try: try:
browser = webdriver.Remote(appium_url, capabilities) browser = webdriver.Remote(appium_url, capabilities)
...@@ -201,8 +202,26 @@ def main(): ...@@ -201,8 +202,26 @@ def main():
tr_count += 1 tr_count += 1
except:
test_line_dict['UnexpectedException'] = {
'test_count': 1,
'error_count': 0,
'failure_count': 1,
'skip_count': 0,
'duration': 1,
'command': url,
'stdout': agent,
'stderr': traceback.format_exc()
}
tool = taskdistribution.TaskDistributionTool(portal_url=args.master_url) finally:
if is_browser_running:
# if by any chance browser is still running due to
# traceback raised make sure we cleanup
browser.quit()
try:
test_result = tool.createTestResult(revision = revision, test_result = tool.createTestResult(revision = revision,
test_name_list = test_line_dict.keys(), test_name_list = test_line_dict.keys(),
node_title = args.test_node_title, node_title = args.test_node_title,
...@@ -220,8 +239,6 @@ def main(): ...@@ -220,8 +239,6 @@ def main():
print 'Submitting: "%s"' % test_result_line.name print 'Submitting: "%s"' % test_result_line.name
# report status back to Nexedi ERP5 # report status back to Nexedi ERP5
test_result_line.stop(**test_line_dict[test_result_line.name]) test_result_line.stop(**test_line_dict[test_result_line.name])
except: except:
# Catch any exception here, to warn user instead of being silent, # Catch any exception here, to warn user instead of being silent,
# by generating fake error result # by generating fake error result
...@@ -233,12 +250,6 @@ def main(): ...@@ -233,12 +250,6 @@ def main():
# XXX: inform test node master of error # XXX: inform test node master of error
raise EnvironmentError(result) raise EnvironmentError(result)
finally:
if is_browser_running:
# if by any chance browser is still running due to
# traceback raised make sure we cleanup
browser.quit()
if __name__ == "__main__": if __name__ == "__main__":
main() 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