From 6cc2b74dbd790ce2320001784129a0af4c72d234 Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Mon, 9 Sep 2024 16:25:34 +0000 Subject: [PATCH 01/13] Attempt to run integration tests on juju 3.6 --- .github/workflows/ci.yaml | 17 ++++--- .github/workflows/juju_3_6_ci.yaml | 50 +++++++++++++++++++ .../ha_tests/test_async_replication.py | 9 +++- .../integration/ha_tests/test_replication.py | 4 +- .../ha_tests/test_rollback_to_master_label.py | 5 +- .../integration/ha_tests/test_self_healing.py | 4 +- tests/integration/ha_tests/test_smoke.py | 6 +-- tests/integration/ha_tests/test_upgrade.py | 3 ++ .../ha_tests/test_upgrade_from_stable.py | 3 ++ .../ha_tests/test_upgrade_to_primary_label.py | 3 ++ tests/integration/helpers.py | 11 ++-- .../new_relations/test_new_relations.py | 29 +++++++---- .../new_relations/test_relations_coherence.py | 4 +- tests/integration/relations/test_relations.py | 6 +-- tests/integration/test_backups_pitr.py | 7 ++- tests/integration/test_charm.py | 8 +-- tests/integration/test_db.py | 6 +-- tests/integration/test_db_admin.py | 5 +- tests/integration/test_tls.py | 3 +- tests/integration/test_trust.py | 2 + tests/integration/test_wrong_arch.py | 6 +-- 21 files changed, 138 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/juju_3_6_ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6376e7a783..558e87d2b4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,14 +7,15 @@ concurrency: cancel-in-progress: true on: - pull_request: - paths-ignore: - - '.gitignore' - - '.jujuignore' - - 'LICENSE' - - '**.md' - - .github/renovate.json5 - - '.github/workflows/sync_docs.yaml' +# TODO: uncomment below before PR merge + # pull_request: + # paths-ignore: + # - '.gitignore' + # - '.jujuignore' + # - 'LICENSE' + # - '**.md' + # - .github/renovate.json5 + # - '.github/workflows/sync_docs.yaml' schedule: - cron: '53 0 * * *' # Daily at 00:53 UTC # Triggered on push to branch "main" by .github/workflows/release.yaml diff --git a/.github/workflows/juju_3_6_ci.yaml b/.github/workflows/juju_3_6_ci.yaml new file mode 100644 index 0000000000..a159bef445 --- /dev/null +++ b/.github/workflows/juju_3_6_ci.yaml @@ -0,0 +1,50 @@ +# Copyright 2024 Canonical Ltd. +# See LICENSE file for licensing details. +name: Juju 3.6 CI tests + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + +jobs: + lint: + name: Lint + uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v18.0.0 + + build: + name: Build charm + uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v18.0.0 + with: + cache: true + + integration-test-3-6: + strategy: + fail-fast: false + matrix: + architecture: + - amd64 + - arm64 + name: Integration | 3.6 | ${{ matrix.architecture }} + needs: + - lint + - build + uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v18.0.0 + with: + artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} + architecture: ${{ matrix.architecture }} + cloud: microk8s + juju-snap-channel: 3.6/beta + libjuju-version-constraint: 3.5.2.0 + microk8s-snap-channel: 1.31-strict/stable + secrets: + # GitHub appears to redact each line of a multi-line secret + # Avoid putting `{` or `}` on a line by itself so that it doesn't get redacted in logs + integration-test: | + { "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", + "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", + "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", + "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}", + } diff --git a/tests/integration/ha_tests/test_async_replication.py b/tests/integration/ha_tests/test_async_replication.py index fd113bda36..394478cddb 100644 --- a/tests/integration/ha_tests/test_async_replication.py +++ b/tests/integration/ha_tests/test_async_replication.py @@ -18,6 +18,7 @@ from .. import architecture, markers from ..helpers import ( APPLICATION_NAME, + CHARM_BASE, DATABASE_APP_NAME, build_and_deploy, get_leader_unit, @@ -112,8 +113,12 @@ async def test_deploy_async_replication_setup( """Build and deploy two PostgreSQL cluster in two separate models to test async replication.""" await build_and_deploy(ops_test, CLUSTER_SIZE, wait_for_idle=False) await build_and_deploy(ops_test, CLUSTER_SIZE, wait_for_idle=False, model=second_model) - await ops_test.model.deploy(APPLICATION_NAME, channel="latest/edge", num_units=1) - await second_model.deploy(APPLICATION_NAME, channel="latest/edge", num_units=1) + await ops_test.model.deploy( + APPLICATION_NAME, channel="latest/edge", num_units=1, base=CHARM_BASE + ) + await second_model.deploy( + APPLICATION_NAME, channel="latest/edge", num_units=1, base=CHARM_BASE + ) async with ops_test.fast_forward(), fast_forward(second_model): await gather( diff --git a/tests/integration/ha_tests/test_replication.py b/tests/integration/ha_tests/test_replication.py index c4a58297db..daaa325c7c 100644 --- a/tests/integration/ha_tests/test_replication.py +++ b/tests/integration/ha_tests/test_replication.py @@ -9,7 +9,7 @@ from ..helpers import ( APPLICATION_NAME, - CHARM_SERIES, + CHARM_BASE, app_name, build_and_deploy, db_connect, @@ -43,7 +43,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: await ops_test.model.deploy( APPLICATION_NAME, application_name=APPLICATION_NAME, - series=CHARM_SERIES, + base=CHARM_BASE, channel="edge", ) diff --git a/tests/integration/ha_tests/test_rollback_to_master_label.py b/tests/integration/ha_tests/test_rollback_to_master_label.py index 86b33c5699..fff7151426 100644 --- a/tests/integration/ha_tests/test_rollback_to_master_label.py +++ b/tests/integration/ha_tests/test_rollback_to_master_label.py @@ -15,7 +15,7 @@ from ..architecture import architecture from ..helpers import ( APPLICATION_NAME, - CHARM_SERIES, + CHARM_BASE, DATABASE_APP_NAME, get_leader_unit, get_primary, @@ -45,13 +45,14 @@ async def test_deploy_stable(ops_test: OpsTest) -> None: num_units=3, channel="14/stable", revision=(280 if architecture == "arm64" else 281), - series=CHARM_SERIES, + base=CHARM_BASE, trust=True, ), ops_test.model.deploy( APPLICATION_NAME, num_units=1, channel="latest/edge", + base=CHARM_BASE, ), ) logger.info("Wait for applications to become active") diff --git a/tests/integration/ha_tests/test_self_healing.py b/tests/integration/ha_tests/test_self_healing.py index 70731da9dc..4fae6c3e9c 100644 --- a/tests/integration/ha_tests/test_self_healing.py +++ b/tests/integration/ha_tests/test_self_healing.py @@ -12,7 +12,7 @@ from .. import markers from ..helpers import ( APPLICATION_NAME, - CHARM_SERIES, + CHARM_BASE, METADATA, app_name, build_and_deploy, @@ -69,7 +69,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: await ops_test.model.deploy( APPLICATION_NAME, application_name=APPLICATION_NAME, - series=CHARM_SERIES, + base=CHARM_BASE, channel="edge", ) diff --git a/tests/integration/ha_tests/test_smoke.py b/tests/integration/ha_tests/test_smoke.py index 286a403688..9c8fe45efd 100644 --- a/tests/integration/ha_tests/test_smoke.py +++ b/tests/integration/ha_tests/test_smoke.py @@ -12,7 +12,7 @@ from .. import markers from ..helpers import ( - CHARM_SERIES, + CHARM_BASE, DATABASE_APP_NAME, scale_application, ) @@ -56,7 +56,7 @@ async def test_app_force_removal(ops_test: OpsTest): application_name=DATABASE_APP_NAME, num_units=1, channel="14/stable", - series=CHARM_SERIES, + base=CHARM_BASE, trust=True, config={"profile": "testing"}, ) @@ -169,7 +169,7 @@ async def test_app_resources_conflicts(ops_test: OpsTest): application_name=DUP_DATABASE_APP_NAME, num_units=1, channel="14/stable", - series=CHARM_SERIES, + base=CHARM_BASE, trust=True, config={"profile": "testing"}, ) diff --git a/tests/integration/ha_tests/test_upgrade.py b/tests/integration/ha_tests/test_upgrade.py index 215ca65995..98c6661217 100644 --- a/tests/integration/ha_tests/test_upgrade.py +++ b/tests/integration/ha_tests/test_upgrade.py @@ -14,6 +14,7 @@ from ..helpers import ( APPLICATION_NAME, + CHARM_BASE, DATABASE_APP_NAME, METADATA, count_switchovers, @@ -44,11 +45,13 @@ async def test_deploy_latest(ops_test: OpsTest) -> None: channel="14/edge", trust=True, config={"profile": "testing"}, + base=CHARM_BASE, ), ops_test.model.deploy( APPLICATION_NAME, num_units=1, channel="latest/edge", + base=CHARM_BASE, ), ) logger.info("Wait for applications to become active") diff --git a/tests/integration/ha_tests/test_upgrade_from_stable.py b/tests/integration/ha_tests/test_upgrade_from_stable.py index e47453a187..11350a595d 100644 --- a/tests/integration/ha_tests/test_upgrade_from_stable.py +++ b/tests/integration/ha_tests/test_upgrade_from_stable.py @@ -13,6 +13,7 @@ from .. import markers from ..helpers import ( APPLICATION_NAME, + CHARM_BASE, DATABASE_APP_NAME, METADATA, count_switchovers, @@ -42,11 +43,13 @@ async def test_deploy_stable(ops_test: OpsTest) -> None: num_units=3, channel="14/stable", trust=True, + base=CHARM_BASE, ), ops_test.model.deploy( APPLICATION_NAME, num_units=1, channel="latest/edge", + base=CHARM_BASE, ), ) logger.info("Wait for applications to become active") diff --git a/tests/integration/ha_tests/test_upgrade_to_primary_label.py b/tests/integration/ha_tests/test_upgrade_to_primary_label.py index 2243217445..bfed2be396 100644 --- a/tests/integration/ha_tests/test_upgrade_to_primary_label.py +++ b/tests/integration/ha_tests/test_upgrade_to_primary_label.py @@ -12,6 +12,7 @@ from .. import markers from ..helpers import ( APPLICATION_NAME, + CHARM_BASE, DATABASE_APP_NAME, get_leader_unit, get_primary, @@ -40,11 +41,13 @@ async def test_deploy_stable(ops_test: OpsTest) -> None: num_units=3, channel="14/stable", trust=True, + base=CHARM_BASE, ), ops_test.model.deploy( APPLICATION_NAME, num_units=1, channel="latest/edge", + base=CHARM_BASE, ), ) logger.info("Wait for applications to become active") diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index 94cc9a822c..8df5575c52 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -32,7 +32,7 @@ wait_fixed, ) -CHARM_SERIES = "jammy" +CHARM_BASE = "ubuntu@22.04" METADATA = yaml.safe_load(Path("./metadata.yaml").read_text()) DATABASE_APP_NAME = METADATA["name"] APPLICATION_NAME = "postgresql-test-app" @@ -94,7 +94,7 @@ async def build_and_deploy( application_name=database_app_name, trust=True, num_units=num_units, - series=CHARM_SERIES, + base=CHARM_BASE, config={"profile": "testing"}, ), ) @@ -293,6 +293,7 @@ async def deploy_and_relate_application_with_postgresql( channel=channel, application_name=application_name, num_units=number_of_units, + base=CHARM_BASE, ) await ops_test.model.wait_for_idle( apps=[application_name], @@ -828,8 +829,10 @@ async def backup_operations( ) -> None: """Basic set of operations for backup testing in different cloud providers.""" # Deploy S3 Integrator and TLS Certificates Operator. - await ops_test.model.deploy(s3_integrator_app_name) - await ops_test.model.deploy(tls_certificates_app_name, config=tls_config, channel=tls_channel) + await ops_test.model.deploy(s3_integrator_app_name, base=CHARM_BASE) + await ops_test.model.deploy( + tls_certificates_app_name, config=tls_config, channel=tls_channel, base=CHARM_BASE + ) # Deploy and relate PostgreSQL to S3 integrator (one database app for each cloud for now # as archivo_mode is disabled after restoring the backup) and to TLS Certificates Operator # (to be able to create backups from replicas). diff --git a/tests/integration/new_relations/test_new_relations.py b/tests/integration/new_relations/test_new_relations.py index beb785bc49..d40d1b28a8 100644 --- a/tests/integration/new_relations/test_new_relations.py +++ b/tests/integration/new_relations/test_new_relations.py @@ -16,7 +16,7 @@ from .. import markers from ..helpers import ( - CHARM_SERIES, + CHARM_BASE, check_database_users_existence, scale_application, ) @@ -56,7 +56,7 @@ async def test_database_relation_with_charm_libraries(ops_test: OpsTest, databas APPLICATION_APP_NAME, application_name=APPLICATION_APP_NAME, num_units=2, - series=CHARM_SERIES, + base=CHARM_BASE, channel="edge", ), ops_test.model.deploy( @@ -68,7 +68,7 @@ async def test_database_relation_with_charm_libraries(ops_test: OpsTest, databas }, application_name=DATABASE_APP_NAME, num_units=3, - series=CHARM_SERIES, + base=CHARM_BASE, trust=True, config={"profile": "testing"}, ), @@ -81,7 +81,7 @@ async def test_database_relation_with_charm_libraries(ops_test: OpsTest, databas }, application_name=ANOTHER_DATABASE_APP_NAME, num_units=3, - series=CHARM_SERIES, + base=CHARM_BASE, trust=True, config={"profile": "testing"}, ), @@ -192,7 +192,7 @@ async def test_two_applications_doesnt_share_the_same_relation_data(ops_test: Op await ops_test.model.deploy( APPLICATION_APP_NAME, application_name=another_application_app_name, - series=CHARM_SERIES, + base=CHARM_BASE, channel="edge", ) await ops_test.model.wait_for_idle(apps=all_app_names, status="active") @@ -449,7 +449,7 @@ async def test_admin_role(ops_test: OpsTest): all_app_names = [DATA_INTEGRATOR_APP_NAME] all_app_names.extend(APP_NAMES) async with ops_test.fast_forward(): - await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME) + await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME, base=CHARM_BASE) await ops_test.model.wait_for_idle(apps=[DATA_INTEGRATOR_APP_NAME], status="blocked") await ops_test.model.applications[DATA_INTEGRATOR_APP_NAME].set_config({ "database-name": DATA_INTEGRATOR_APP_NAME.replace("-", "_"), @@ -538,7 +538,9 @@ async def test_invalid_extra_user_roles(ops_test: OpsTest): another_data_integrator_app_name = f"another-{DATA_INTEGRATOR_APP_NAME}" data_integrator_apps_names = [DATA_INTEGRATOR_APP_NAME, another_data_integrator_app_name] await ops_test.model.deploy( - DATA_INTEGRATOR_APP_NAME, application_name=another_data_integrator_app_name + DATA_INTEGRATOR_APP_NAME, + application_name=another_data_integrator_app_name, + base=CHARM_BASE, ) await ops_test.model.wait_for_idle( apps=[another_data_integrator_app_name], status="blocked" @@ -593,7 +595,7 @@ async def test_discourse(ops_test: OpsTest): await gather( ops_test.model.deploy(DISCOURSE_APP_NAME, application_name=DISCOURSE_APP_NAME), ops_test.model.deploy( - REDIS_APP_NAME, application_name=REDIS_APP_NAME, channel="latest/edge" + REDIS_APP_NAME, application_name=REDIS_APP_NAME, channel="latest/edge", base=CHARM_BASE ), ) @@ -670,12 +672,17 @@ async def test_indico_datatabase(ops_test: OpsTest) -> None: async with ops_test.fast_forward(fast_interval="30s"): await ops_test.model.deploy( "indico", - channel="stable", + channel="latest/edge", application_name="indico", num_units=1, + base=CHARM_BASE, + ) + await ops_test.model.deploy( + "redis-k8s", channel="stable", application_name="redis-broker", base=CHARM_BASE + ) + await ops_test.model.deploy( + "redis-k8s", channel="stable", application_name="redis-cache", base=CHARM_BASE ) - await ops_test.model.deploy("redis-k8s", channel="stable", application_name="redis-broker") - await ops_test.model.deploy("redis-k8s", channel="stable", application_name="redis-cache") await asyncio.gather( ops_test.model.relate("redis-broker", "indico:redis-broker"), ops_test.model.relate("redis-cache", "indico:redis-cache"), diff --git a/tests/integration/new_relations/test_relations_coherence.py b/tests/integration/new_relations/test_relations_coherence.py index cb08f2b560..6df0fce6a9 100644 --- a/tests/integration/new_relations/test_relations_coherence.py +++ b/tests/integration/new_relations/test_relations_coherence.py @@ -9,7 +9,7 @@ import pytest from pytest_operator.plugin import OpsTest -from ..helpers import DATABASE_APP_NAME, build_and_deploy +from ..helpers import CHARM_BASE, DATABASE_APP_NAME, build_and_deploy from .helpers import build_connection_string from .test_new_relations import DATA_INTEGRATOR_APP_NAME @@ -30,7 +30,7 @@ async def test_relations(ops_test: OpsTest, database_charm): await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=3000) # Creating first time relation with user role - await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME) + await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME, base=CHARM_BASE) await ops_test.model.applications[DATA_INTEGRATOR_APP_NAME].set_config({ "database-name": DATA_INTEGRATOR_APP_NAME.replace("-", "_"), }) diff --git a/tests/integration/relations/test_relations.py b/tests/integration/relations/test_relations.py index ccab3b6f3d..0d33cf38ee 100644 --- a/tests/integration/relations/test_relations.py +++ b/tests/integration/relations/test_relations.py @@ -7,7 +7,7 @@ import pytest from pytest_operator.plugin import OpsTest -from ..helpers import CHARM_SERIES +from ..helpers import CHARM_BASE from ..new_relations.test_new_relations import ( APPLICATION_APP_NAME, DATABASE_APP_METADATA, @@ -34,7 +34,7 @@ async def test_deploy_charms(ops_test: OpsTest, database_charm): APPLICATION_APP_NAME, application_name=APPLICATION_APP_NAME, num_units=1, - series=CHARM_SERIES, + base=CHARM_BASE, channel="edge", ), ops_test.model.deploy( @@ -46,7 +46,7 @@ async def test_deploy_charms(ops_test: OpsTest, database_charm): }, application_name=APP_NAME, num_units=1, - series=CHARM_SERIES, + base=CHARM_BASE, config={ "profile": "testing", "plugin_unaccent_enable": "True", diff --git a/tests/integration/test_backups_pitr.py b/tests/integration/test_backups_pitr.py index e531ec6d02..e70259247d 100644 --- a/tests/integration/test_backups_pitr.py +++ b/tests/integration/test_backups_pitr.py @@ -12,6 +12,7 @@ from . import architecture from .helpers import ( + CHARM_BASE, DATABASE_APP_NAME, MOVE_RESTORED_CLUSTER_TO_ANOTHER_BUCKET, build_and_deploy, @@ -104,8 +105,10 @@ async def pitr_backup_operations( ) -> None: """Utility function containing PITR backup operations for both cloud tests.""" # Deploy S3 Integrator and TLS Certificates Operator. - await ops_test.model.deploy(s3_integrator_app_name) - await ops_test.model.deploy(tls_certificates_app_name, config=tls_config, channel=tls_channel) + await ops_test.model.deploy(s3_integrator_app_name, base=CHARM_BASE) + await ops_test.model.deploy( + tls_certificates_app_name, config=tls_config, channel=tls_channel, base=CHARM_BASE + ) # Deploy and relate PostgreSQL to S3 integrator (one database app for each cloud for now # as archivo_mode is disabled after restoring the backup) and to TLS Certificates Operator # (to be able to create backups from replicas). diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index 15ade275ee..72dc5763f6 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -14,7 +14,7 @@ from tenacity import Retrying, stop_after_delay, wait_fixed from .helpers import ( - CHARM_SERIES, + CHARM_BASE, METADATA, STORAGE_PATH, build_and_deploy, @@ -389,7 +389,7 @@ async def test_redeploy_charm_same_model(ops_test: OpsTest): }, application_name=APP_NAME, num_units=len(UNIT_IDS), - series=CHARM_SERIES, + base=CHARM_BASE, trust=True, config={"profile": "testing"}, ) @@ -433,7 +433,7 @@ async def test_redeploy_charm_same_model_after_forcing_removal(ops_test: OpsTest }, application_name=APP_NAME, num_units=len(UNIT_IDS), - series=CHARM_SERIES, + base=CHARM_BASE, trust=True, config={"profile": "testing"}, ) @@ -461,7 +461,7 @@ async def test_storage_with_more_restrictive_permissions(ops_test: OpsTest): }, application_name=app_name, num_units=1, - series=CHARM_SERIES, + base=CHARM_BASE, trust=True, config={"profile": "testing"}, ) diff --git a/tests/integration/test_db.py b/tests/integration/test_db.py index f266174bc5..3e2a858b70 100644 --- a/tests/integration/test_db.py +++ b/tests/integration/test_db.py @@ -10,7 +10,7 @@ from . import markers from .helpers import ( APPLICATION_NAME, - CHARM_SERIES, + CHARM_BASE, DATABASE_APP_NAME, build_and_deploy, check_database_creation, @@ -107,13 +107,13 @@ async def test_extensions_blocking(ops_test: OpsTest) -> None: await ops_test.model.deploy( APPLICATION_NAME, application_name=APPLICATION_NAME, - series=CHARM_SERIES, + series=CHARM_BASE, channel="edge", ) await ops_test.model.deploy( APPLICATION_NAME, application_name=f"{APPLICATION_NAME}2", - series=CHARM_SERIES, + series=CHARM_BASE, channel="edge", ) diff --git a/tests/integration/test_db_admin.py b/tests/integration/test_db_admin.py index 6d023331d8..ff9de8fa64 100644 --- a/tests/integration/test_db_admin.py +++ b/tests/integration/test_db_admin.py @@ -8,6 +8,7 @@ from . import markers from .helpers import ( + CHARM_BASE, DATABASE_APP_NAME, build_and_deploy, check_database_creation, @@ -30,7 +31,9 @@ async def test_discourse_from_discourse_charmers(ops_test: OpsTest): async with ops_test.fast_forward(): await asyncio.gather( build_and_deploy(ops_test, DATABASE_UNITS), - ops_test.model.deploy(REDIS_APP_NAME, application_name=REDIS_APP_NAME), + ops_test.model.deploy( + REDIS_APP_NAME, application_name=REDIS_APP_NAME, base=CHARM_BASE + ), ) await ops_test.model.wait_for_idle( apps=[DATABASE_APP_NAME, REDIS_APP_NAME], status="active", timeout=1500 diff --git a/tests/integration/test_tls.py b/tests/integration/test_tls.py index bb51644ed1..153689b094 100644 --- a/tests/integration/test_tls.py +++ b/tests/integration/test_tls.py @@ -13,6 +13,7 @@ change_patroni_setting, ) from .helpers import ( + CHARM_BASE, DATABASE_APP_NAME, build_and_deploy, check_database_creation, @@ -83,7 +84,7 @@ async def test_tls(ops_test: OpsTest) -> None: async with ops_test.fast_forward(): # Deploy TLS Certificates operator. await ops_test.model.deploy( - tls_certificates_app_name, config=tls_config, channel=tls_channel + tls_certificates_app_name, config=tls_config, channel=tls_channel, base=CHARM_BASE ) # Relate it to the PostgreSQL to enable TLS. await ops_test.model.relate(DATABASE_APP_NAME, tls_certificates_app_name) diff --git a/tests/integration/test_trust.py b/tests/integration/test_trust.py index 675365998e..82b553b52d 100644 --- a/tests/integration/test_trust.py +++ b/tests/integration/test_trust.py @@ -10,6 +10,7 @@ from pytest_operator.plugin import OpsTest from .helpers import ( + CHARM_BASE, METADATA, get_leader_unit, ) @@ -96,6 +97,7 @@ async def test_deploy_without_trust(ops_test: OpsTest, database_charm): application_name=APP_NAME, num_units=3, trust=False, + base=CHARM_BASE, ) await ops_test.model.block_until( diff --git a/tests/integration/test_wrong_arch.py b/tests/integration/test_wrong_arch.py index 9cfcbcbb45..e05456e7a5 100644 --- a/tests/integration/test_wrong_arch.py +++ b/tests/integration/test_wrong_arch.py @@ -12,7 +12,7 @@ from pytest_operator.plugin import OpsTest from . import markers -from .helpers import CHARM_SERIES, DATABASE_APP_NAME, METADATA +from .helpers import CHARM_BASE, DATABASE_APP_NAME, METADATA logger = logging.getLogger(__name__) @@ -47,7 +47,7 @@ async def test_arm_charm_on_amd_host(ops_test: OpsTest) -> None: application_name=DATABASE_APP_NAME, trust=True, num_units=1, - series=CHARM_SERIES, + base=CHARM_BASE, config={"profile": "testing"}, ) @@ -70,7 +70,7 @@ async def test_amd_charm_on_arm_host(ops_test: OpsTest) -> None: application_name=DATABASE_APP_NAME, trust=True, num_units=1, - series=CHARM_SERIES, + base=CHARM_BASE, config={"profile": "testing"}, ) From 52271e160f044a0a2647fbffd96279fab89b08b1 Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Mon, 23 Sep 2024 19:54:51 +0000 Subject: [PATCH 02/13] Change pgdata permissions to 0o700 + fix charm bases in tests --- src/charm.py | 4 +++- tests/integration/test_db.py | 4 ++-- tests/integration/test_db_admin.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/charm.py b/src/charm.py index 6a5e448a6d..9c79a57a32 100755 --- a/src/charm.py +++ b/src/charm.py @@ -864,8 +864,10 @@ def _create_pgdata(self, container: Container): path = f"{self._storage_path}/pgdata" if not container.exists(path): container.make_dir( - path, permissions=0o770, user=WORKLOAD_OS_USER, group=WORKLOAD_OS_GROUP + path, permissions=0o700, user=WORKLOAD_OS_USER, group=WORKLOAD_OS_GROUP ) + else: + container.exec(["chmod", "700", path]).wait() # Also, fix the permissions from the parent directory. container.exec([ "chown", diff --git a/tests/integration/test_db.py b/tests/integration/test_db.py index 3e2a858b70..c234654d33 100644 --- a/tests/integration/test_db.py +++ b/tests/integration/test_db.py @@ -107,13 +107,13 @@ async def test_extensions_blocking(ops_test: OpsTest) -> None: await ops_test.model.deploy( APPLICATION_NAME, application_name=APPLICATION_NAME, - series=CHARM_BASE, + base=CHARM_BASE, channel="edge", ) await ops_test.model.deploy( APPLICATION_NAME, application_name=f"{APPLICATION_NAME}2", - series=CHARM_BASE, + base=CHARM_BASE, channel="edge", ) diff --git a/tests/integration/test_db_admin.py b/tests/integration/test_db_admin.py index ff9de8fa64..c380880f6a 100644 --- a/tests/integration/test_db_admin.py +++ b/tests/integration/test_db_admin.py @@ -32,7 +32,7 @@ async def test_discourse_from_discourse_charmers(ops_test: OpsTest): await asyncio.gather( build_and_deploy(ops_test, DATABASE_UNITS), ops_test.model.deploy( - REDIS_APP_NAME, application_name=REDIS_APP_NAME, base=CHARM_BASE + REDIS_APP_NAME, application_name=REDIS_APP_NAME, base="ubuntu@20.04" ), ) await ops_test.model.wait_for_idle( From 42a9e017573883df1828e4bc39f25ba81ff29606 Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Mon, 23 Sep 2024 20:35:53 +0000 Subject: [PATCH 03/13] Remove import to fix lint warning --- tests/integration/test_db_admin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integration/test_db_admin.py b/tests/integration/test_db_admin.py index c380880f6a..8d1a5c94fa 100644 --- a/tests/integration/test_db_admin.py +++ b/tests/integration/test_db_admin.py @@ -8,7 +8,6 @@ from . import markers from .helpers import ( - CHARM_BASE, DATABASE_APP_NAME, build_and_deploy, check_database_creation, From e7d7b5aa892b1ee9278af4db588831c0ddccc794 Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Tue, 24 Sep 2024 00:41:17 +0000 Subject: [PATCH 04/13] Set pg data permissions to 750 explicitly so it works well with pgbackrest --- src/charm.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/charm.py b/src/charm.py index 746561dc5e..3624c37e2c 100755 --- a/src/charm.py +++ b/src/charm.py @@ -884,10 +884,8 @@ def _create_pgdata(self, container: Container): """Create the PostgreSQL data directory.""" if not container.exists(self.pgdata_path): container.make_dir( - self.pgdata_path, permissions=0o700, user=WORKLOAD_OS_USER, group=WORKLOAD_OS_GROUP + self.pgdata_path, permissions=0o750, user=WORKLOAD_OS_USER, group=WORKLOAD_OS_GROUP ) - else: - container.exec(["chmod", "700", self.pgdata_path]).wait() # Also, fix the permissions from the parent directory. container.exec([ "chown", From e42332dd4f487a1307d7095ef1d1382c0a376c76 Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Tue, 24 Sep 2024 01:08:24 +0000 Subject: [PATCH 05/13] Use base ubuntu@20.04 for finos-waltz-k8s --- tests/integration/test_db.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/test_db.py b/tests/integration/test_db.py index c234654d33..4afb20754d 100644 --- a/tests/integration/test_db.py +++ b/tests/integration/test_db.py @@ -66,6 +66,7 @@ async def test_finos_waltz_db(ops_test: OpsTest) -> None: ANOTHER_FINOS_WALTZ_APP_NAME, APPLICATION_UNITS, channel="edge", + base="ubuntu@20.04", ) # In this case, the database name is the same as in the first deployment # because it's a fixed value in Finos Waltz charm. From 47dfc6b4c70e6af36fac65a1fd40197b84c7d5db Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Tue, 24 Sep 2024 11:54:32 +0000 Subject: [PATCH 06/13] Deploy charms without jammy support with base ubuntu@20.04 --- tests/integration/helpers.py | 4 +++- tests/integration/new_relations/test_new_relations.py | 4 ++-- tests/integration/test_db.py | 7 ++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index 0788d01fe1..f23c276cb9 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -271,6 +271,7 @@ async def deploy_and_relate_application_with_postgresql( channel: str = "stable", relation: str = "db", status: str = "blocked", + base: str = CHARM_BASE, ) -> int: """Helper function to deploy and relate application with PostgreSQL. @@ -283,6 +284,7 @@ async def deploy_and_relate_application_with_postgresql( relation: Name of the PostgreSQL relation to relate the application to. status: The status to wait for in the application (default: blocked). + base: The base of the charm to deploy Returns: the id of the created relation. @@ -293,7 +295,7 @@ async def deploy_and_relate_application_with_postgresql( channel=channel, application_name=application_name, num_units=number_of_units, - base=CHARM_BASE, + base=base, ) await ops_test.model.wait_for_idle( apps=[application_name], diff --git a/tests/integration/new_relations/test_new_relations.py b/tests/integration/new_relations/test_new_relations.py index 9b862537b2..b9befe1b6d 100644 --- a/tests/integration/new_relations/test_new_relations.py +++ b/tests/integration/new_relations/test_new_relations.py @@ -682,10 +682,10 @@ async def test_indico_datatabase(ops_test: OpsTest) -> None: base=CHARM_BASE, ) await ops_test.model.deploy( - "redis-k8s", channel="stable", application_name="redis-broker", base=CHARM_BASE + "redis-k8s", channel="stable", application_name="redis-broker", base="ubuntu@20.04" ) await ops_test.model.deploy( - "redis-k8s", channel="stable", application_name="redis-cache", base=CHARM_BASE + "redis-k8s", channel="stable", application_name="redis-cache", base="ubuntu@20.04" ) await asyncio.gather( ops_test.model.relate("redis-broker", "indico:redis-broker"), diff --git a/tests/integration/test_db.py b/tests/integration/test_db.py index 4afb20754d..658aa6b713 100644 --- a/tests/integration/test_db.py +++ b/tests/integration/test_db.py @@ -51,7 +51,12 @@ async def test_finos_waltz_db(ops_test: OpsTest) -> None: # Deploy and test the first deployment of Finos Waltz. relation_id = await deploy_and_relate_application_with_postgresql( - ops_test, "finos-waltz-k8s", FINOS_WALTZ_APP_NAME, APPLICATION_UNITS, channel="edge" + ops_test, + "finos-waltz-k8s", + FINOS_WALTZ_APP_NAME, + APPLICATION_UNITS, + channel="edge", + base="ubuntu@20.04", ) await check_database_creation(ops_test, "waltz") From 0e198f9628350cade31249b4c5272d4b81f4febf Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Wed, 2 Oct 2024 17:59:34 +0000 Subject: [PATCH 07/13] Test against juju 3.6/edge due to secrets related fixes + deploy mattermost with ubuntu@20.04 --- .github/workflows/juju_3_6_ci.yaml | 2 +- poetry.lock | 11 ++++++----- pyproject.toml | 2 +- tests/integration/test_tls.py | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/juju_3_6_ci.yaml b/.github/workflows/juju_3_6_ci.yaml index a159bef445..5cc9f377e6 100644 --- a/.github/workflows/juju_3_6_ci.yaml +++ b/.github/workflows/juju_3_6_ci.yaml @@ -36,7 +36,7 @@ jobs: artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} architecture: ${{ matrix.architecture }} cloud: microk8s - juju-snap-channel: 3.6/beta + juju-snap-channel: 3.6/edge libjuju-version-constraint: 3.5.2.0 microk8s-snap-channel: 1.31-strict/stable secrets: diff --git a/poetry.lock b/poetry.lock index 8a16a20811..d66c68e287 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1247,13 +1247,13 @@ files = [ [[package]] name = "ops" -version = "2.16.1" +version = "2.17.0" description = "The Python library behind great charms" optional = false python-versions = ">=3.8" files = [ - {file = "ops-2.16.1-py3-none-any.whl", hash = "sha256:11b0466ebb8c80f2a3a11752b63f5ab3b145d7520bc743281d7e7b19c12ac79d"}, - {file = "ops-2.16.1.tar.gz", hash = "sha256:64315cd114cd5f445ce0f382ecebe431dd05620a7917f76eb2d77632fdea8cbb"}, + {file = "ops-2.17.0-py3-none-any.whl", hash = "sha256:b6b7cebd1897bc1ea26312f1ddece693fbb5b392d5a395d5deef59204b98925e"}, + {file = "ops-2.17.0.tar.gz", hash = "sha256:04f298bed94bfde3dd38ba39d309cda03d595273e815add6d0affb110cacb77b"}, ] [package.dependencies] @@ -1261,7 +1261,8 @@ PyYAML = "==6.*" websocket-client = "==1.*" [package.extras] -docs = ["canonical-sphinx-extensions", "furo", "linkify-it-py", "myst-parser", "pyspelling", "sphinx (>=8.0.0,<8.1.0)", "sphinx-autobuild", "sphinx-copybutton", "sphinx-design", "sphinx-notfound-page", "sphinx-tabs", "sphinxcontrib-jquery", "sphinxext-opengraph"] +docs = ["canonical-sphinx-extensions", "furo", "linkify-it-py", "myst-parser", "ops-scenario (>=7.0.5,<8)", "pyspelling", "sphinx (>=8.0.0,<8.1.0)", "sphinx-autobuild", "sphinx-copybutton", "sphinx-design", "sphinx-notfound-page", "sphinx-tabs", "sphinxcontrib-jquery", "sphinxext-opengraph"] +testing = ["ops-scenario (>=7.0.5,<8)"] [[package]] name = "packaging" @@ -2501,4 +2502,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "e8620a22950d5e343c24598dbb5d295af7c1e6bce116e95752085e5a92d985f3" +content-hash = "b8042c33a97d0fb9dfc1235b88833494091686331e032ce0518e0f61da51b5be" diff --git a/pyproject.toml b/pyproject.toml index ac72a2ce50..54a784f11e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ package-mode = false [tool.poetry.dependencies] python = "^3.10" -ops = "^2.16.1" +ops = "^2.17.0" cryptography = "^43.0.1" boto3 = "^1.35.24" pgconnstr = "^1.0.1" diff --git a/tests/integration/test_tls.py b/tests/integration/test_tls.py index 153689b094..aefa33b220 100644 --- a/tests/integration/test_tls.py +++ b/tests/integration/test_tls.py @@ -192,7 +192,7 @@ async def test_mattermost_db(ops_test: OpsTest) -> None: async with ops_test.fast_forward(): # Deploy and check Mattermost user and database existence. relation_id = await deploy_and_relate_application_with_postgresql( - ops_test, "mattermost-k8s", MATTERMOST_APP_NAME, APPLICATION_UNITS, status="waiting" + ops_test, "mattermost-k8s", MATTERMOST_APP_NAME, APPLICATION_UNITS, status="waiting", base="ubuntu@20.04" ) await check_database_creation(ops_test, "mattermost") From f39d919ea0b7f2f13bd19151fd7930daca444471 Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Thu, 7 Nov 2024 10:24:20 +0000 Subject: [PATCH 08/13] Run tests against juju 3.6/stable --- .github/workflows/juju_3_6_ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/juju_3_6_ci.yaml b/.github/workflows/juju_3_6_ci.yaml index 5cc9f377e6..ac45d18b4d 100644 --- a/.github/workflows/juju_3_6_ci.yaml +++ b/.github/workflows/juju_3_6_ci.yaml @@ -36,7 +36,7 @@ jobs: artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} architecture: ${{ matrix.architecture }} cloud: microk8s - juju-snap-channel: 3.6/edge + juju-snap-channel: 3.6/stable libjuju-version-constraint: 3.5.2.0 microk8s-snap-channel: 1.31-strict/stable secrets: From 95d869dc1ca1515e2d857b85bc415b071d51b48c Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Thu, 7 Nov 2024 11:48:43 +0000 Subject: [PATCH 09/13] Run tests against 3.6/candidate and not 3.6/stable --- .github/workflows/juju_3_6_ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/juju_3_6_ci.yaml b/.github/workflows/juju_3_6_ci.yaml index ac45d18b4d..7f49795264 100644 --- a/.github/workflows/juju_3_6_ci.yaml +++ b/.github/workflows/juju_3_6_ci.yaml @@ -36,7 +36,7 @@ jobs: artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} architecture: ${{ matrix.architecture }} cloud: microk8s - juju-snap-channel: 3.6/stable + juju-snap-channel: 3.6/candidate libjuju-version-constraint: 3.5.2.0 microk8s-snap-channel: 1.31-strict/stable secrets: From 29ae647b2962394496fad29e01c4066864dc069f Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Wed, 13 Nov 2024 12:19:47 +0000 Subject: [PATCH 10/13] Run juju 3.6 tests only on a nightly schedule --- .github/workflows/ci.yaml | 26 ++++++++++------ .github/workflows/juju_3_6_ci.yaml | 50 ------------------------------ 2 files changed, 16 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/juju_3_6_ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index be8ea48818..b3fc61ed3b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,15 +7,14 @@ concurrency: cancel-in-progress: true on: -# TODO: uncomment below before PR merge - # pull_request: - # paths-ignore: - # - '.gitignore' - # - '.jujuignore' - # - 'LICENSE' - # - '**.md' - # - .github/renovate.json5 - # - '.github/workflows/sync_docs.yaml' + pull_request: + paths-ignore: + - '.gitignore' + - '.jujuignore' + - 'LICENSE' + - '**.md' + - .github/renovate.json5 + - '.github/workflows/sync_docs.yaml' schedule: - cron: '53 0 * * *' # Daily at 00:53 UTC # Triggered on push to branch "main" by .github/workflows/release.yaml @@ -60,6 +59,8 @@ jobs: allure_on_amd64: false - agent: 3.4.6 # renovate: juju-agent-pin-minor allure_on_amd64: true + - snap_channel: 3.6/candidate + allure_on_amd64: false architecture: - amd64 include: @@ -67,7 +68,11 @@ jobs: agent: 3.4.6 # renovate: juju-agent-pin-minor allure_on_amd64: true architecture: arm64 - name: Integration | ${{ matrix.juju.agent }} | ${{ matrix.architecture }} + - juju: + snap_channel: 3.6/candidate + allure_on_amd64: false + architecture: arm64 + name: Integration | ${{ matrix.juju.agent || matrix.juju.snap_channel }} | ${{ matrix.architecture }} needs: - lint - unit-test @@ -79,6 +84,7 @@ jobs: cloud: microk8s microk8s-snap-channel: 1.31-strict/stable # renovate: latest microk8s juju-agent-version: ${{ matrix.juju.agent }} + juju-snap-channel: ${{ matrix.juju.snap_channel }} libjuju-version-constraint: ${{ matrix.juju.libjuju }} _beta_allure_report: ${{ matrix.juju.allure_on_amd64 && matrix.architecture == 'amd64' }} secrets: diff --git a/.github/workflows/juju_3_6_ci.yaml b/.github/workflows/juju_3_6_ci.yaml deleted file mode 100644 index 7f49795264..0000000000 --- a/.github/workflows/juju_3_6_ci.yaml +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2024 Canonical Ltd. -# See LICENSE file for licensing details. -name: Juju 3.6 CI tests - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - pull_request: - -jobs: - lint: - name: Lint - uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v18.0.0 - - build: - name: Build charm - uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v18.0.0 - with: - cache: true - - integration-test-3-6: - strategy: - fail-fast: false - matrix: - architecture: - - amd64 - - arm64 - name: Integration | 3.6 | ${{ matrix.architecture }} - needs: - - lint - - build - uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v18.0.0 - with: - artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} - architecture: ${{ matrix.architecture }} - cloud: microk8s - juju-snap-channel: 3.6/candidate - libjuju-version-constraint: 3.5.2.0 - microk8s-snap-channel: 1.31-strict/stable - secrets: - # GitHub appears to redact each line of a multi-line secret - # Avoid putting `{` or `}` on a line by itself so that it doesn't get redacted in logs - integration-test: | - { "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", - "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", - "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", - "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}", - } From 61a55cef611dc600e83d7868695731476527059b Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Wed, 13 Nov 2024 12:28:36 +0000 Subject: [PATCH 11/13] Address missed case of series->base after merge of main into branch --- tests/integration/new_relations/test_new_relations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/new_relations/test_new_relations.py b/tests/integration/new_relations/test_new_relations.py index 7c07da0c25..06e3701423 100644 --- a/tests/integration/new_relations/test_new_relations.py +++ b/tests/integration/new_relations/test_new_relations.py @@ -609,7 +609,7 @@ async def test_database_deploy_clientapps(ops_test: OpsTest, database_charm): }, application_name=DATABASE_APP_NAME, num_units=3, - series=CHARM_SERIES, + base=CHARM_BASE, trust=True, config={"profile": "testing"}, ), From 2e95476cd405dac3bf119bd1939f0edee6649c80 Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Thu, 14 Nov 2024 17:08:29 +0000 Subject: [PATCH 12/13] Address Dragomir's feedback on test failures due to nuances of python libjuju --- .../ha_tests/test_upgrade_to_primary_label.py | 10 +++++++++- tests/integration/helpers.py | 1 + tests/integration/new_relations/test_new_relations.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/integration/ha_tests/test_upgrade_to_primary_label.py b/tests/integration/ha_tests/test_upgrade_to_primary_label.py index 805829562b..a3835370c1 100644 --- a/tests/integration/ha_tests/test_upgrade_to_primary_label.py +++ b/tests/integration/ha_tests/test_upgrade_to_primary_label.py @@ -14,11 +14,13 @@ from ..helpers import ( APPLICATION_NAME, CHARM_BASE, + CHARM_SERIES, DATABASE_APP_NAME, get_leader_unit, get_primary, get_unit_by_index, ) +from ..juju_ import juju_major_version from .helpers import ( are_writes_increasing, check_writes, @@ -36,6 +38,12 @@ @pytest.mark.abort_on_fail async def test_deploy_stable(ops_test: OpsTest) -> None: """Simple test to ensure that the PostgreSQL and application charms get deployed.""" + database_additional_params = {} + if juju_major_version >= 3: + database_additional_params["base"] = CHARM_BASE + else: + database_additional_params["series"] = CHARM_SERIES + await asyncio.gather( ops_test.model.deploy( DATABASE_APP_NAME, @@ -43,7 +51,7 @@ async def test_deploy_stable(ops_test: OpsTest) -> None: channel="14/stable", revision=(280 if architecture == "arm64" else 281), trust=True, - base=CHARM_BASE, + **database_additional_params, ), ops_test.model.deploy( APPLICATION_NAME, diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index 528e0cec9f..9a0c4c5c0c 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -34,6 +34,7 @@ ) CHARM_BASE = "ubuntu@22.04" +CHARM_SERIES = "jammy" METADATA = yaml.safe_load(Path("./metadata.yaml").read_text()) DATABASE_APP_NAME = METADATA["name"] APPLICATION_NAME = "postgresql-test-app" diff --git a/tests/integration/new_relations/test_new_relations.py b/tests/integration/new_relations/test_new_relations.py index 06e3701423..3ea23f45e1 100644 --- a/tests/integration/new_relations/test_new_relations.py +++ b/tests/integration/new_relations/test_new_relations.py @@ -710,7 +710,7 @@ async def test_indico_datatabase(ops_test: OpsTest) -> None: channel="latest/edge", application_name="indico", num_units=1, - base=CHARM_BASE, + base="ubuntu@20.04", ) await ops_test.model.deploy( "redis-k8s", channel="stable", application_name="redis-broker", base="ubuntu@20.04" From 8ad240371d415deca9723b31590d082304c0efa6 Mon Sep 17 00:00:00 2001 From: Shayan Patel Date: Thu, 14 Nov 2024 21:51:24 +0000 Subject: [PATCH 13/13] Use series for the indico charm as the usage of bases shows incompatibility with focal --- tests/integration/new_relations/test_new_relations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/new_relations/test_new_relations.py b/tests/integration/new_relations/test_new_relations.py index 3ea23f45e1..61bcbfdaa4 100644 --- a/tests/integration/new_relations/test_new_relations.py +++ b/tests/integration/new_relations/test_new_relations.py @@ -710,7 +710,7 @@ async def test_indico_datatabase(ops_test: OpsTest) -> None: channel="latest/edge", application_name="indico", num_units=1, - base="ubuntu@20.04", + series="focal", ) await ops_test.model.deploy( "redis-k8s", channel="stable", application_name="redis-broker", base="ubuntu@20.04"