Skip to content

Commit 232c069

Browse files
authored
[MISC] Remove psql setpriv shim and switch stable upgrade tests to 16/stable (#1041)
* Stable refresh and snap bump * Set series in coherence test * Set series in new rel test
1 parent f3f3756 commit 232c069

File tree

5 files changed

+45
-50
lines changed

5 files changed

+45
-50
lines changed

refresh_versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ name = "charmed-postgresql"
66

77
[snap.revisions]
88
# amd64
9-
x86_64 = "201"
9+
x86_64 = "203"
1010
# arm64
11-
aarch64 = "202"
11+
aarch64 = "204"

tests/integration/ha_tests/test_upgrade.py

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import platform
66
import shutil
77
import zipfile
8+
from asyncio import gather
89
from pathlib import Path
910

1011
import pytest
@@ -33,23 +34,16 @@
3334
@pytest.mark.abort_on_fail
3435
async def test_deploy_latest(ops_test: OpsTest) -> None:
3536
"""Simple test to ensure that the PostgreSQL and application charms get deployed."""
36-
await ops_test.juju(
37-
"deploy",
38-
DATABASE_APP_NAME,
39-
"-n",
40-
3,
41-
"--channel",
42-
"16/edge",
43-
"--config",
44-
"profile=testing",
45-
"--base",
46-
47-
)
48-
await ops_test.model.deploy(
49-
APPLICATION_NAME,
50-
num_units=1,
51-
channel="latest/edge",
52-
config={"sleep_interval": 500},
37+
await gather(
38+
ops_test.model.deploy(
39+
DATABASE_APP_NAME, num_units=3, channel="16/edge", config={"profile": "testing"}
40+
),
41+
ops_test.model.deploy(
42+
APPLICATION_NAME,
43+
num_units=1,
44+
channel="latest/edge",
45+
config={"sleep_interval": 500},
46+
),
5347
)
5448
logger.info("Wait for applications to become active")
5549
async with ops_test.fast_forward():

tests/integration/ha_tests/test_upgrade_from_stable.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright 2023 Canonical Ltd.
22
# See LICENSE file for licensing details.
33
import logging
4+
from asyncio import gather
45

56
import pytest
67
from pytest_operator.plugin import OpsTest
@@ -26,22 +27,16 @@
2627
@pytest.mark.abort_on_fail
2728
async def test_deploy_stable(ops_test: OpsTest) -> None:
2829
"""Simple test to ensure that the PostgreSQL and application charms get deployed."""
29-
await ops_test.juju(
30-
"deploy",
31-
DATABASE_APP_NAME,
32-
"-n",
33-
3,
34-
# TODO move to stable once we release refresh v3 to stable
35-
"--channel",
36-
"16/edge",
37-
"--base",
38-
39-
)
40-
await ops_test.model.deploy(
41-
APPLICATION_NAME,
42-
num_units=1,
43-
channel="latest/edge",
44-
config={"sleep_interval": 500},
30+
await gather(
31+
ops_test.model.deploy(
32+
DATABASE_APP_NAME, num_units=3, channel="16/stable", config={"profile": "testing"}
33+
),
34+
ops_test.model.deploy(
35+
APPLICATION_NAME,
36+
num_units=1,
37+
channel="latest/edge",
38+
config={"sleep_interval": 500},
39+
),
4540
)
4641
logger.info("Wait for applications to become active")
4742
async with ops_test.fast_forward():

tests/integration/new_relations/test_new_relations_1.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ async def test_two_applications_doesnt_share_the_same_relation_data(ops_test: Op
236236
await ops_test.model.deploy(
237237
APPLICATION_APP_NAME,
238238
application_name=another_application_app_name,
239-
channel="edge",
239+
channel="latest/edge",
240240
base=CHARM_BASE,
241241
)
242242
await ops_test.model.wait_for_idle(apps=all_app_names, status="active")
@@ -465,15 +465,20 @@ async def test_relation_with_no_database_name(ops_test: OpsTest):
465465

466466
async def test_invalid_extra_user_roles(ops_test: OpsTest):
467467
async with ops_test.fast_forward():
468-
await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME, base=CHARM_BASE)
468+
# Base is ignored
469+
await ops_test.model.deploy(
470+
DATA_INTEGRATOR_APP_NAME, channel="latest/edge", series="noble"
471+
)
469472
await ops_test.model.wait_for_idle(apps=[DATA_INTEGRATOR_APP_NAME], status="blocked")
470473

471474
another_data_integrator_app_name = f"another-{DATA_INTEGRATOR_APP_NAME}"
472475
data_integrator_apps_names = [DATA_INTEGRATOR_APP_NAME, another_data_integrator_app_name]
476+
# Base is ignored
473477
await ops_test.model.deploy(
474478
DATA_INTEGRATOR_APP_NAME,
475479
application_name=another_data_integrator_app_name,
476-
base=CHARM_BASE,
480+
channel="latest/edge",
481+
series="noble",
477482
)
478483
await ops_test.model.wait_for_idle(
479484
apps=[another_data_integrator_app_name], status="blocked"

tests/integration/new_relations/test_relations_coherence.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55
import secrets
66
import string
7+
from asyncio import gather
78

89
import psycopg2
910
import pytest
@@ -26,23 +27,23 @@
2627
async def test_relations(ops_test: OpsTest, charm):
2728
"""Test that check relation data."""
2829
async with ops_test.fast_forward():
29-
await ops_test.model.deploy(
30-
charm,
31-
application_name=DATABASE_APP_NAME,
32-
num_units=1,
33-
base=CHARM_BASE,
34-
config={"profile": "testing"},
30+
await gather(
31+
ops_test.model.deploy(
32+
charm,
33+
application_name=DATABASE_APP_NAME,
34+
num_units=1,
35+
base=CHARM_BASE,
36+
config={"profile": "testing"},
37+
),
38+
# Creating first time relation with user role
39+
# Base is ignored
40+
ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME, series="noble"),
3541
)
36-
await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=3000)
37-
38-
# Creating first time relation with user role
39-
await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME, base=CHARM_BASE)
4042
await ops_test.model.applications[DATA_INTEGRATOR_APP_NAME].set_config({
4143
"database-name": DATA_INTEGRATOR_APP_NAME.replace("-", "_"),
4244
})
43-
await ops_test.model.wait_for_idle(apps=[DATA_INTEGRATOR_APP_NAME], status="blocked")
4445
await ops_test.model.add_relation(DATA_INTEGRATOR_APP_NAME, DATABASE_APP_NAME)
45-
await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active")
46+
await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active", timeout=1500)
4647

4748
connection_string = await build_connection_string(
4849
ops_test,

0 commit comments

Comments
 (0)