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
[template-run-zelenium]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template/run-zelenium-test.py.in
md5sum = b78c7f5db0e9c9de9b96ac600da675a6
md5sum = ab554dc5e57b8002e51b0f86074311a3
output = ${buildout:directory}/run-zelenium-test.py.in
mode = 755
......
......@@ -105,6 +105,7 @@ def main():
# Wait until all bt5 are installed...
time.sleep(120)
tool = taskdistribution.TaskDistributionTool(portal_url=args.master_url)
try:
browser = webdriver.Remote(appium_url, capabilities)
......@@ -201,8 +202,26 @@ def main():
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_name_list = test_line_dict.keys(),
node_title = args.test_node_title,
......@@ -220,8 +239,6 @@ def main():
print 'Submitting: "%s"' % test_result_line.name
# report status back to Nexedi ERP5
test_result_line.stop(**test_line_dict[test_result_line.name])
except:
# Catch any exception here, to warn user instead of being silent,
# by generating fake error result
......@@ -233,12 +250,6 @@ def main():
# XXX: inform test node master of error
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__":
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