CLIP-1510: Handle 6.x and 8.x+ versions

This commit is contained in:
Adam Brokes 2022-07-06 15:04:51 +10:00
parent 245b53c476
commit 1f4f33360a
No known key found for this signature in database
GPG Key ID: D0853F559CE0213B
2 changed files with 9 additions and 20 deletions

View File

@ -11,10 +11,11 @@
<property name="webwork.multipart.saveDir">${localHome}/temp</property>
<property name="attachments.dir">${confluenceHome}/attachments</property>
{% if confluence_version.split(".")[1] | int() <= 13 %}
{% set db_pool_variable = "c3p0" %}
{% if (confluence_version.split(".")[0] | int() == 7 and confluence_version.split(".")[1] | int() <= 13) or confluence_version.split(".")[0] | int() < 7 %}
{% set db_pool_variable = "c3p0" %}
{% else %}
{% set db_pool_variable = "hikari" %}
{% set db_pool_variable = "hikari" %}
{% endif %}
<property name="lucene.index.dir">{{ atl_lucene_index_dir | default('${confluenceHome}/index') }}</property>

View File

@ -498,27 +498,15 @@ def test_confluence_xml_force_overwrite(docker_cli, image, run_user):
assert xml.findall('.//property[@name="confluence.webapp.context.path"]')[0].text == "/myconf"
def test_confluence_db_pool_version_7_13(docker_cli, image, run_user):
@pytest.mark.parametrize("version,db_property", [('7.13.7', 'c3p0'), ('7.17.7', 'hikari'), ('6.9.0', 'c3p0'), ('8.0.0', 'hikari')])
def test_confluence_db_pool_property(docker_cli, image, version, db_property):
environment = {
'CONFLUENCE_VERSION': '7.13.7',
'CONFLUENCE_VERSION': version,
'ATL_JDBC_URL': 'postgresql:hostname',
'ATL_DB_TYPE': 'postgresql'
}
container = run_image(docker_cli, image, user=run_user, environment=environment)
container = run_image(docker_cli, image, environment=environment)
xml = parse_xml(container, f'{get_app_home(container)}/confluence.cfg.xml')
assert xml.findall('.//property[@name="hibernate.c3p0.min_size"]')[0].text == "20"
def test_confluence_db_pool_version_7_14(docker_cli, image, run_user):
environment = {
'CONFLUENCE_VERSION': '7.17.7',
'ATL_JDBC_URL': 'postgresql:hostname',
'ATL_DB_TYPE': 'postgresql'
}
container = run_image(docker_cli, image, user=run_user, environment=environment)
xml = parse_xml(container, f'{get_app_home(container)}/confluence.cfg.xml')
assert xml.findall('.//property[@name="hibernate.hikari.min_size"]')[0].text == "20"
assert xml.findall(f'.//property[@name="hibernate.{db_property}.min_size"]')[0].text == "20"