Commit 8635c753 authored by Jérome Perrin's avatar Jérome Perrin Committed by Tatuya Kamada

erp5: repair instanciation when no test runner is generated

The case where test runner is not enabled got broken in
2a457867
parent db56d052
......@@ -74,7 +74,7 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5]
filename = instance-erp5.cfg.in
md5sum = d6e98e66dbff9077d6d8e6d3ea23e48a
md5sum = 3beaeda87f9affefb87ef106977c7a2a
[template-zeo]
filename = instance-zeo.cfg.in
......@@ -86,7 +86,7 @@ md5sum = 7415a758c1076888d675aca1d9440b22
[template-balancer]
filename = instance-balancer.cfg.in
md5sum = a4caf55109bd12740e4f29c3931776b1
md5sum = de0aa4aabb74e688f308bf2b1e9f4a71
[template-haproxy-cfg]
filename = haproxy.cfg.in
......
......@@ -136,7 +136,7 @@ ipv6 = {{ zope_address.split(']:')[0][1:] }}
{% set test_runner_apache_url_list = [] %}
{% set test_runner_external_port = next_port() %}
{% for i, (test_runner_internal_ip, test_runner_internal_port) in
enumerate(slapparameter_dict[parameter_id ~ '-test-runner-address-list']) %}
enumerate(slapparameter_dict.get(parameter_id ~ '-test-runner-address-list', [])) %}
{% do test_runner_backend_mapping.__setitem__(
'unit_test_' ~ i,
'http://' ~ test_runner_internal_ip ~ ':' ~ test_runner_internal_port ) %}
......
......@@ -195,7 +195,9 @@ config-longrequest-logger-timeout = {{ dumps(zope_parameter_dict.get('longreques
config-large-file-threshold = {{ dumps(zope_parameter_dict.get('large-file-threshold', "10MB")) }}
config-port-base = {{ dumps(zope_parameter_dict.get('port-base', 2200)) }}
config-webdav = {{ dumps(zope_parameter_dict.get('webdav', False)) }}
{% if test_runner_enabled -%}
config-test-runner-apache-url-list = ${publish-early:{{ zope_family }}-test-runner-url-list}
{% endif -%}
{% endfor -%}
{# if not explicitly configured, connect jupyter to first zope family, which -#}
......@@ -324,9 +326,11 @@ hosts-dict = {{ '${' ~ zope_address_list_id_dict.keys()[0] ~ ':connection-hosts-
{% for name, value in publish_dict.items() -%}
{{ name }} = {{ value }}
{% endfor -%}
{% for zope_family_name in zope_family_name_list -%}
{% if test_runner_enabled -%}
{% for zope_family_name in zope_family_name_list -%}
{{ zope_family_name }}-test-runner-url-list = ${request-balancer:connection-{{ zope_family_name }}-test-runner-url-list}
{% endfor -%}
{% endfor -%}
{% endif -%}
[publish-early]
......@@ -337,9 +341,11 @@ recipe = slapos.cookbook:publish-early
{%- if has_posftix %}
smtpd-sasl-password gen-smtpd-sasl-password:passwd
{%- endif %}
{% for zope_family_name in zope_family_name_list %}
{% if test_runner_enabled -%}
{% for zope_family_name in zope_family_name_list %}
{{ zope_family_name }}-test-runner-url-list default-balancer-test-runner-url-list:default
{% endfor -%}
{% endfor -%}
{% endif -%}
{%- if neo %}
neo-cluster gen-neo-cluster:name
{%- if neo[0] %}
......
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