Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions tests/integration/ha_tests/test_async_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from .. import architecture, markers
from ..helpers import (
APPLICATION_NAME,
CHARM_BASE,
DATABASE_APP_NAME,
build_and_deploy,
get_leader_unit,
Expand Down Expand Up @@ -110,11 +109,9 @@ async def test_deploy_async_replication_setup(
await build_and_deploy(ops_test, charm, CLUSTER_SIZE, wait_for_idle=False)
await build_and_deploy(ops_test, charm, CLUSTER_SIZE, wait_for_idle=False, model=second_model)
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
APPLICATION_NAME, channel="latest/edge", num_units=1, series="jammy"
)
await second_model.deploy(APPLICATION_NAME, channel="latest/edge", num_units=1, series="jammy")

async with ops_test.fast_forward(), fast_forward(second_model):
await gather(
Expand Down
5 changes: 2 additions & 3 deletions tests/integration/ha_tests/test_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from ..helpers import (
APPLICATION_NAME,
CHARM_BASE,
DATABASE_APP_NAME,
app_name,
build_and_deploy,
Expand Down Expand Up @@ -43,8 +42,8 @@ async def test_build_and_deploy(ops_test: OpsTest, charm) -> None:
await ops_test.model.deploy(
APPLICATION_NAME,
application_name=APPLICATION_NAME,
base=CHARM_BASE,
channel="edge",
channel="latest/edge",
series="jammy",
)

if wait_for_apps:
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/ha_tests/test_restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ async def test_deploy(ops_test: OpsTest, charm) -> None:
"""Build and deploy a PostgreSQL cluster and a test application."""
await build_and_deploy(ops_test, charm, CLUSTER_SIZE, wait_for_idle=False)
if not await app_name(ops_test, APPLICATION_NAME):
await ops_test.model.deploy(APPLICATION_NAME, num_units=1)
await ops_test.model.deploy(
APPLICATION_NAME, num_units=1, channel="latest/edge", series="jammy"
)

await ops_test.model.relate(DATABASE_APP_NAME, f"{APPLICATION_NAME}:database")

Expand Down
5 changes: 2 additions & 3 deletions tests/integration/ha_tests/test_self_healing_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from .. import markers
from ..helpers import (
APPLICATION_NAME,
CHARM_BASE,
DATABASE_APP_NAME,
METADATA,
app_name,
Expand Down Expand Up @@ -67,8 +66,8 @@ async def test_build_and_deploy(ops_test: OpsTest, charm) -> None:
await ops_test.model.deploy(
APPLICATION_NAME,
application_name=APPLICATION_NAME,
base=CHARM_BASE,
channel="edge",
channel="latest/edge",
series="jammy",
)

if wait_for_apps:
Expand Down
5 changes: 2 additions & 3 deletions tests/integration/ha_tests/test_self_healing_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from ..helpers import (
APPLICATION_NAME,
CHARM_BASE,
DATABASE_APP_NAME,
METADATA,
app_name,
Expand Down Expand Up @@ -48,8 +47,8 @@ async def test_build_and_deploy(ops_test: OpsTest, charm) -> None:
await ops_test.model.deploy(
APPLICATION_NAME,
application_name=APPLICATION_NAME,
base=CHARM_BASE,
channel="edge",
channel="latest/edge",
series="jammy",
)

if wait_for_apps:
Expand Down
5 changes: 1 addition & 4 deletions tests/integration/ha_tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ async def test_deploy_latest(ops_test: OpsTest) -> None:
base=CHARM_BASE,
),
ops_test.model.deploy(
APPLICATION_NAME,
num_units=1,
channel="latest/edge",
base=CHARM_BASE,
APPLICATION_NAME, num_units=1, channel="latest/edge", series="jammy"
),
)
await ops_test.model.relate(DATABASE_APP_NAME, f"{APPLICATION_NAME}:database")
Expand Down
5 changes: 1 addition & 4 deletions tests/integration/ha_tests/test_upgrade_from_stable.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ async def test_deploy_stable(ops_test: OpsTest) -> None:
base=CHARM_BASE,
),
ops_test.model.deploy(
APPLICATION_NAME,
num_units=1,
channel="latest/edge",
base=CHARM_BASE,
APPLICATION_NAME, num_units=1, channel="latest/edge", series="jammy"
),
)
await ops_test.model.relate(DATABASE_APP_NAME, f"{APPLICATION_NAME}:database")
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/new_relations/test_new_relations_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ async def test_database_relation_with_charm_libraries(ops_test: OpsTest, charm):
APPLICATION_APP_NAME,
application_name=APPLICATION_APP_NAME,
num_units=2,
base=CHARM_BASE,
channel="latest/edge",
series="jammy",
config={"extra_user_roles": "CREATEDB,CREATEROLE"},
),
ops_test.model.deploy(
Expand Down Expand Up @@ -187,8 +187,8 @@ 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,
base=CHARM_BASE,
channel="edge",
channel="latest/edge",
series="jammy",
)

# Relate the new application with the database
Expand Down
8 changes: 0 additions & 8 deletions tests/integration/new_relations/test_new_relations_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,12 @@

logger = logging.getLogger(__name__)

APPLICATION_APP_NAME = "postgresql-test-app"
DATABASE_APP_NAME = "database"
ANOTHER_DATABASE_APP_NAME = "another-database"
DATA_INTEGRATOR_APP_NAME = "data-integrator"
DISCOURSE_APP_NAME = "discourse-k8s"
REDIS_APP_NAME = "redis-k8s"
APP_NAMES = [APPLICATION_APP_NAME, DATABASE_APP_NAME, ANOTHER_DATABASE_APP_NAME]
DATABASE_APP_METADATA = yaml.safe_load(Path("./metadata.yaml").read_text())
FIRST_DATABASE_RELATION_NAME = "database"
SECOND_DATABASE_RELATION_NAME = "second-database"
MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME = "multiple-database-clusters"
ALIASED_MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME = "aliased-multiple-database-clusters"
NO_DATABASE_RELATION_NAME = "no-database"
INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE = "invalid role(s) for extra user roles"


@pytest.mark.abort_on_fail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

logger = logging.getLogger(__name__)

APPLICATION_APP_NAME = "postgresql-test-app"
APP_NAMES = [DATABASE_APP_NAME, DATA_INTEGRATOR_APP_NAME]
FIRST_DATABASE_RELATION_NAME = "database"

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/relations/test_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ async def test_deploy_charms(ops_test: OpsTest, charm):
APPLICATION_APP_NAME,
application_name=APPLICATION_APP_NAME,
num_units=1,
base=CHARM_BASE,
channel="latest/edge",
series="jammy",
),
ops_test.model.deploy(
charm,
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/test_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
async def test_audit_plugin(ops_test: OpsTest, charm) -> None:
"""Test the audit plugin."""
await asyncio.gather(
build_and_deploy(ops_test, charm, 1), ops_test.model.deploy(APPLICATION_NAME)
build_and_deploy(ops_test, charm, 1),
ops_test.model.deploy(APPLICATION_NAME, channel="latest/edge", series="jammy"),
)
await ops_test.model.relate(f"{APPLICATION_NAME}:{RELATION_ENDPOINT}", DATABASE_APP_NAME)
async with ops_test.fast_forward():
Expand Down
10 changes: 3 additions & 7 deletions tests/integration/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from . import markers
from .helpers import (
APPLICATION_NAME,
CHARM_BASE,
DATABASE_APP_NAME,
build_and_deploy,
check_database_creation,
Expand Down Expand Up @@ -109,16 +108,13 @@ async def test_finos_waltz_db(ops_test: OpsTest, charm) -> None:
# (and this test depends on previous test with finos-waltz-k8s charm)
async def test_extensions_blocking(ops_test: OpsTest) -> None:
await ops_test.model.deploy(
APPLICATION_NAME,
application_name=APPLICATION_NAME,
base=CHARM_BASE,
channel="edge",
APPLICATION_NAME, application_name=APPLICATION_NAME, channel="latest/edge", series="jammy"
)
await ops_test.model.deploy(
APPLICATION_NAME,
application_name=f"{APPLICATION_NAME}2",
base=CHARM_BASE,
channel="edge",
channel="latest/edge",
series="jammy",
)

await ops_test.model.wait_for_idle(
Expand Down