Commit 86814cc2 authored by Xiaowu Zhang's avatar Xiaowu Zhang

stask/erp5: generate different runTestSuite according to parameter

if saucelabs_dict is present, then generate delegate runTestSuite to launch test with saucelab
else default one is created
parent 90b10c1b
......@@ -158,6 +158,13 @@ rendered = ${buildout:directory}/instance-caucase.cfg
<= download-base-neo
url = ${:_profile_base_location_}/${:filename}
[template-run-zelenium]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template/run-zelenium-test.py.in
md5sum = 8c42f98228f0ae9dc16ee2dab739b818
output = ${buildout:directory}/run-zelenium-test.py.in
mode = 755
[check-recipe]
recipe = plone.recipe.command
stop-on-error = true
......@@ -285,6 +292,7 @@ context =
key root_common root-common:target
key site_zcml site-zcml:target
key sixtunnel_location 6tunnel:location
key template_run_zelenium template-run-zelenium:output
key stunnel_location stunnel:location
key template_apache_conf template-apache-backend-conf:target
key template_balancer template-balancer:target
......@@ -549,6 +557,7 @@ eggs = ${neoppod:eggs}
# Needed for parsing .po files from our Localizer subset
polib
selenium
# Needed for Google OAuth
google-api-python-client
......@@ -797,3 +806,6 @@ unidiff = 0.5.5
# deepdiff = 3.3.0
jsonpickle = 0.9.6
decorator = 4.3.0
selenium = 3.8.0
......@@ -66,7 +66,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0
[template]
filename = instance.cfg.in
md5sum = 330b72acf0752cce5da70b1fcdfac487
md5sum = 50db2da70232c91642c93dc06c982b3c
[monitor-template-dummy]
filename = dummy.cfg
......@@ -74,7 +74,7 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5]
filename = instance-erp5.cfg.in
md5sum = 9f8851af5faed9d1e346d7dbe0e6db5d
md5sum = 83e0f627633ec3e394dc27d06c627b3b
[template-zeo]
filename = instance-zeo.cfg.in
......@@ -82,7 +82,7 @@ md5sum = 3e650915959ff31c9c13c84069bbcd35
[template-zope]
filename = instance-zope.cfg.in
md5sum = a4dda17c1671ead45ac92b7decc32228
md5sum = 40574986b5a75e5c888737797ee6973e
[template-balancer]
filename = instance-balancer.cfg.in
......
......@@ -152,6 +152,7 @@ config-caucase-url = ${request-caucase:connection-http-url}
config-cloudooo-url = {{ dumps(slapparameter_dict.get('cloudooo-url', default_cloudooo_url)) }}
config-deadlock-debugger-password = ${publish-early:deadlock-debugger-password}
config-developer-list = {{ dumps(slapparameter_dict.get('developer-list', [inituser_login])) }}
config-saucelabs-dict = {{ dumps(slapparameter_dict.get('saucelabs-dict', {})) }}
config-hosts-dict = {{ dumps(slapparameter_dict.get('hosts-dict', {})) }}
config-hostalias-dict = {{ dumps(slapparameter_dict.get('hostalias-dict', {})) }}
config-id-store-interval = {{ dumps(slapparameter_dict.get('id-store-interval')) }}
......
......@@ -4,6 +4,7 @@
{% set zodb_dict = slapparameter_dict['zodb-dict'] -%}
{% set instance_index_list = range(slapparameter_dict['instance-count']) -%}
{% set node_id_base = slapparameter_dict['name'] -%}
{% set saucelabs_dict = slapparameter_dict.get('saucelabs-dict', None) -%}
{% set node_id_index_format = '-%%0%ii' % (len(str(instance_index_list[-1])), ) -%}
{% set part_list = [] -%}
{% set publish_list = [] -%}
......@@ -67,6 +68,23 @@ ca-certs = ${directory:test-ca-certs}
ca-newcerts = ${directory:test-ca-newcerts}
ca-crl = ${directory:test-ca-crl}
{% if saucelabs_dict -%}
[test-zelenium-runner-parameter]
configuration = {{ dumps(saucelabs_dict) }}
user = {{ dumps(slapparameter_dict['inituser-login']) }}
password = {{ dumps(slapparameter_dict['inituser-password']) }}
[{{ section('test-zelenium-runner') }}]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['run-zelenium-template'] }}
rendered = ${directory:bin}/runTestSuite
extensions = jinja2.ext.do
context =
import json_module json
key configuration test-zelenium-runner-parameter:configuration
key user test-zelenium-runner-parameter:user
key password test-zelenium-runner-parameter:password
{% else -%}
{% if slapparameter_dict['mysql-test-url-list'] -%}
[{{ section('run-unit-test-userhosts-wrapper') }}]
<= userhosts-wrapper-base
......@@ -125,6 +143,7 @@ command-name = runTestSuite
command-line-extra =
--db_list '{{ ','.join(connection_string_list) }}'
{%- endif %}
{%- endif %}
[directory]
recipe = slapos.cookbook:mkdirectory
......
......@@ -84,6 +84,7 @@ extra-context =
[dynamic-template-zope-parameters]
bin-directory = {{ bin_directory }}
zope-conf-template = {{ template_zope_conf }}
run-zelenium-template = {{ template_run_zelenium }}
buildout-bin-directory = {{ buildout_bin_directory }}
6tunnel = {{ sixtunnel_location }}
coreutils = {{ coreutils_location }}
......
This diff is collapsed.
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