Skip to content

Commit caf9601

Browse files
authored
[MISC] Fix data integrator tests (#1033)
* Fix data integrator tests * Set test app extra user roles
1 parent ec7e6d7 commit caf9601

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

tests/integration/new_relations/test_new_relations_1.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ async def test_database_relation_with_charm_libraries(ops_test: OpsTest, charm):
5454
application_name=APPLICATION_APP_NAME,
5555
num_units=2,
5656
base=CHARM_BASE,
57-
channel="edge",
57+
channel="latest/edge",
58+
# TODO remove when setting predefined roles
59+
config={"extra_user_roles": "CREATEDB,CREATEROLE"},
5860
),
5961
ops_test.model.deploy(
6062
charm,
@@ -192,7 +194,7 @@ async def test_two_applications_doesnt_share_the_same_relation_data(ops_test: Op
192194
APPLICATION_APP_NAME,
193195
application_name=another_application_app_name,
194196
base=CHARM_BASE,
195-
channel="edge",
197+
channel="latest/edge",
196198
)
197199
await ops_test.model.wait_for_idle(apps=all_app_names, status="active")
198200

@@ -452,7 +454,9 @@ async def test_admin_role(ops_test: OpsTest):
452454
all_app_names = [DATA_INTEGRATOR_APP_NAME]
453455
all_app_names.extend(APP_NAMES)
454456
async with ops_test.fast_forward():
455-
await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME, base=CHARM_BASE)
457+
await ops_test.model.deploy(
458+
DATA_INTEGRATOR_APP_NAME, channel="latest/edge", series="noble"
459+
)
456460
await ops_test.model.wait_for_idle(apps=[DATA_INTEGRATOR_APP_NAME], status="blocked")
457461
await ops_test.model.applications[DATA_INTEGRATOR_APP_NAME].set_config({
458462
"database-name": DATA_INTEGRATOR_APP_NAME.replace("-", "_"),
@@ -544,7 +548,8 @@ async def test_invalid_extra_user_roles(ops_test: OpsTest):
544548
await ops_test.model.deploy(
545549
DATA_INTEGRATOR_APP_NAME,
546550
application_name=another_data_integrator_app_name,
547-
base=CHARM_BASE,
551+
channel="latest/edge",
552+
series="noble",
548553
)
549554
await ops_test.model.wait_for_idle(
550555
apps=[another_data_integrator_app_name], status="blocked"

tests/integration/new_relations/test_relations_coherence.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from constants import DATABASE_DEFAULT_NAME
1313

14-
from ..helpers import CHARM_BASE, DATABASE_APP_NAME, build_and_deploy
14+
from ..helpers import DATABASE_APP_NAME, build_and_deploy
1515
from .helpers import build_connection_string
1616
from .test_new_relations_1 import DATA_INTEGRATOR_APP_NAME
1717

@@ -31,7 +31,7 @@ async def test_relations(ops_test: OpsTest, charm):
3131
await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=3000)
3232

3333
# Creating first time relation with user role
34-
await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME, base=CHARM_BASE)
34+
await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME, series="noble")
3535
await ops_test.model.applications[DATA_INTEGRATOR_APP_NAME].set_config({
3636
"database-name": DATA_INTEGRATOR_APP_NAME.replace("-", "_"),
3737
})

0 commit comments

Comments
 (0)