Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address Dragomir's feedback on test failures due to nuances of python…
Browse files Browse the repository at this point in the history
… libjuju
shayancanonical committed Nov 14, 2024
1 parent 61a55ce commit 2e95476
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion tests/integration/ha_tests/test_upgrade_to_primary_label.py
Original file line number Diff line number Diff line change
@@ -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,14 +38,20 @@
@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,
num_units=3,
channel="14/stable",
revision=(280 if architecture == "arm64" else 281),
trust=True,
base=CHARM_BASE,
**database_additional_params,
),
ops_test.model.deploy(
APPLICATION_NAME,
1 change: 1 addition & 0 deletions tests/integration/helpers.py
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion tests/integration/new_relations/test_new_relations.py
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 2e95476

Please sign in to comment.