Commit 7333ff11 authored by Xiaowu Zhang's avatar Xiaowu Zhang

stack/erp5: fix saucelab test issue

/reviewed-on !561
parents 1434fd65 57ad50fb
......@@ -66,7 +66,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0
[template-run-zelenium]
filename = run-zelenium-test.py.in
md5sum = 37f94ecf60876bbe30877773dfe9828b
md5sum = c64f35f825200fe35328641b2b8e0fdd
[template]
filename = instance.cfg.in
......@@ -86,7 +86,7 @@ md5sum = d400c3d449ce437a0ded77ee3d5c5df2
[template-zope]
filename = instance-zope.cfg.in
md5sum = 3a6c7dec898abc7d1506957154ef566e
md5sum = 5cbfcc02ffe6c2ae8cdf412134addd8f
[template-balancer]
filename = instance-balancer.cfg.in
......
......@@ -391,6 +391,10 @@ wrapper-path = ${buildout:bin-directory}/${:_buildout_section_name_}
[{{ section("wait_activities") }}]
<= watch_activities
{% if test_runner_enabled and test_runner_node_count -%}
{% for _ in range(test_runner_node_count) %}
{% do test_runner_address_list.append((ipv4, next_port())) %}
{% endfor %}
{% if saucelabs_dict -%}
[test-zelenium-runner-parameter]
......@@ -411,11 +415,6 @@ context =
key password test-zelenium-runner-parameter:password
key bin_path test-zelenium-runner-parameter:bin-path
{% else -%}
{% if test_runner_enabled and test_runner_node_count -%}
{% for _ in range(test_runner_node_count) %}
{% do test_runner_address_list.append((ipv4, next_port())) %}
{% endfor %}
[{{ section('run-unit-test-userhosts-wrapper') }}]
<= userhosts-wrapper-base
wrapped-command-line = ${runUnitTest:wrapper-path}
......
......@@ -12,6 +12,7 @@ from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
from urllib import urlopen
import json
def main():
parser = argparse.ArgumentParser(description='Run a test suite.')
......@@ -110,20 +111,29 @@ def main():
"&__ac_password=%s" % (args.remote_access_url, {{ repr(user) }}, {{ repr(password) }})
# Wait until all activities are finished...
wait_url = args.remote_access_url + '/erp5/Zuite_waitForActivities'
wait_url = "%s/erp5/ActivityTool_getSqlStatisticList" \
"?__ac_name=%s" \
"&__ac_password=%s" % (args.remote_access_url, {{ repr(user) }}, {{ repr(password) }})
while 1:
try:
response = urlopen(wait_url)
try:
if response.code == 500:
sys.exit(-1)
if response.code == 200 and response.read() == 'Done.':
if response.code == 200:
static_dict = json.loads(response.read())
activity_list = []
for _, value in static_dict.iteritems():
activity_list += value['line_list']
if len(activity_list) == 0:
break
elif all(x['node'] == -2 for x in activity_list):
sys.exit(-1)
finally:
response.close()
except Exception:
traceback.print_exc()
time.sleep(10)
time.sleep(600)
tool = taskdistribution.TaskDistributor(portal_url=args.master_url)
browser = webdriver.Remote(appium_url, capabilities)
......
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