Skip to content

Commit 01cfd3e

Browse files
[DPE-4977] Run tests against juju 3.6 on a nightly schedule (#601)
* Ensure that integration tests pass on juju 3.6 and amd64 * Correctly comment pull_request CI + always run integration tests against latest lxd version * Use juju-snap-channel instead of juju-agent-version * Update pylibjuju to 3.5.2.0 * Revert libjuju to 3.5.0.0 * Explicity specify base as [email protected] instead of using series=jammy * Use libjuju 3.5.0.0 in juju 3.6 workflow * Only run juju 3.6 tests on nightly schedule * Add juju snap channel to the integration CI name
1 parent 61bd261 commit 01cfd3e

21 files changed

+73
-59
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,20 @@ jobs:
5959
allure_on_amd64: false
6060
- agent: 3.4.5 # renovate: juju-agent-pin-minor
6161
allure_on_amd64: true
62+
- snap_channel: 3.6/beta
63+
allure_on_amd64: false
6264
architecture:
6365
- amd64
6466
include:
6567
- juju:
6668
agent: 3.4.5 # renovate: juju-agent-pin-minor
6769
allure_on_amd64: true
6870
architecture: arm64
69-
name: Integration | ${{ matrix.juju.agent }} | ${{ matrix.architecture }}
71+
- juju:
72+
snap_channel: 3.6/beta
73+
allure_on_amd64: false
74+
architecture: arm64
75+
name: Integration | ${{ matrix.juju.agent || matrix.juju.snap_channel }} | ${{ matrix.architecture }}
7076
needs:
7177
- lint
7278
- unit-test
@@ -76,8 +82,8 @@ jobs:
7682
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
7783
architecture: ${{ matrix.architecture }}
7884
cloud: lxd
79-
lxd-snap-channel: 5.21/stable
8085
juju-agent-version: ${{ matrix.juju.agent }}
86+
juju-snap-channel: ${{ matrix.juju.snap_channel }}
8187
libjuju-version-constraint: ${{ matrix.juju.libjuju }}
8288
_beta_allure_report: ${{ matrix.juju.allure_on_amd64 && matrix.architecture == 'amd64' }}
8389
secrets:

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pytest-operator = "^0.36.0"
6666
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.1", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
6767
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.1", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
6868
# renovate caret doesn't work: https://github.com/renovatebot/renovate/issues/26940
69-
juju = "<=3.5.0.0"
69+
juju = "3.5.0.0"
7070
boto3 = "*"
7171
tenacity = "*"
7272
landscape-api-py3 = "^0.9.0"

tests/integration/ha_tests/test_replication.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pytest_operator.plugin import OpsTest
77
from tenacity import Retrying, stop_after_delay, wait_fixed
88

9-
from ..helpers import APPLICATION_NAME, CHARM_SERIES, db_connect, scale_application
9+
from ..helpers import APPLICATION_NAME, CHARM_BASE, db_connect, scale_application
1010
from .helpers import (
1111
app_name,
1212
are_writes_increasing,
@@ -32,7 +32,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
3232
await ops_test.model.deploy(
3333
charm,
3434
num_units=3,
35-
series=CHARM_SERIES,
35+
base=CHARM_BASE,
3636
config={"profile": "testing"},
3737
)
3838
# Deploy the continuous writes application charm if it wasn't already deployed.
@@ -42,7 +42,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
4242
await ops_test.model.deploy(
4343
APPLICATION_NAME,
4444
application_name=APPLICATION_NAME,
45-
series=CHARM_SERIES,
45+
base=CHARM_BASE,
4646
channel="edge",
4747
)
4848

@@ -122,7 +122,7 @@ async def test_no_data_replicated_between_clusters(ops_test: OpsTest, continuous
122122
charm,
123123
application_name=new_cluster_app,
124124
num_units=2,
125-
series=CHARM_SERIES,
125+
base=CHARM_BASE,
126126
config={"profile": "testing"},
127127
)
128128
await ops_test.model.wait_for_idle(

tests/integration/ha_tests/test_restore_cluster.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from pytest_operator.plugin import OpsTest
88

99
from ..helpers import (
10-
CHARM_SERIES,
10+
CHARM_BASE,
1111
db_connect,
1212
get_password,
1313
get_patroni_cluster,
@@ -41,7 +41,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
4141
charm,
4242
application_name=FIRST_APPLICATION,
4343
num_units=3,
44-
series=CHARM_SERIES,
44+
base=CHARM_BASE,
4545
storage={"pgdata": {"pool": "lxd-btrfs", "size": 2048}},
4646
config={"profile": "testing"},
4747
)
@@ -51,7 +51,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
5151
charm,
5252
application_name=SECOND_APPLICATION,
5353
num_units=1,
54-
series=CHARM_SERIES,
54+
base=CHARM_BASE,
5555
config={"profile": "testing"},
5656
)
5757

tests/integration/ha_tests/test_self_healing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from tenacity import Retrying, stop_after_delay, wait_fixed
1111

1212
from ..helpers import (
13-
CHARM_SERIES,
13+
CHARM_BASE,
1414
db_connect,
1515
get_machine_from_unit,
1616
get_password,
@@ -76,7 +76,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
7676
await ops_test.model.deploy(
7777
charm,
7878
num_units=3,
79-
series=CHARM_SERIES,
79+
base=CHARM_BASE,
8080
storage={"pgdata": {"pool": "lxd-btrfs", "size": 2048}},
8181
config={"profile": "testing"},
8282
)
@@ -87,7 +87,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
8787
await ops_test.model.deploy(
8888
APPLICATION_NAME,
8989
application_name=APPLICATION_NAME,
90-
series=CHARM_SERIES,
90+
base=CHARM_BASE,
9191
channel="edge",
9292
)
9393

tests/integration/ha_tests/test_smoke.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from ..helpers import (
1414
APPLICATION_NAME,
15-
CHARM_SERIES,
15+
CHARM_BASE,
1616
)
1717
from ..juju_ import juju_major_version
1818
from .helpers import (
@@ -44,7 +44,7 @@ async def test_app_force_removal(ops_test: OpsTest, charm: str):
4444
charm,
4545
application_name=APPLICATION_NAME,
4646
num_units=1,
47-
series=CHARM_SERIES,
47+
base=CHARM_BASE,
4848
storage={"pgdata": {"pool": "lxd-btrfs", "size": 8046}},
4949
config={"profile": "testing"},
5050
)
@@ -150,7 +150,7 @@ async def test_app_resources_conflicts_v3(ops_test: OpsTest, charm: str):
150150
charm,
151151
application_name=DUP_APPLICATION_NAME,
152152
num_units=1,
153-
series=CHARM_SERIES,
153+
base=CHARM_BASE,
154154
attach_storage=[tag.storage(garbage_storage)],
155155
config={"profile": "testing"},
156156
)
@@ -191,7 +191,7 @@ async def test_app_resources_conflicts_v2(ops_test: OpsTest, charm: str):
191191
charm,
192192
application_name=DUP_APPLICATION_NAME,
193193
num_units=1,
194-
series=CHARM_SERIES,
194+
base=CHARM_BASE,
195195
config={"profile": "testing"},
196196
)
197197

tests/integration/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
wait_fixed,
3232
)
3333

34-
CHARM_SERIES = "jammy"
34+
CHARM_BASE = "[email protected]"
3535
METADATA = yaml.safe_load(Path("./metadata.yaml").read_text())
3636
DATABASE_APP_NAME = METADATA["name"]
3737
STORAGE_PATH = METADATA["storage"]["pgdata"]["location"]
@@ -1118,7 +1118,7 @@ async def backup_operations(
11181118
charm,
11191119
application_name=database_app_name,
11201120
num_units=2,
1121-
series=CHARM_SERIES,
1121+
base=CHARM_BASE,
11221122
config={"profile": "testing"},
11231123
)
11241124

tests/integration/new_relations/test_new_relations.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from pytest_operator.plugin import OpsTest
1414

1515
from .. import markers
16-
from ..helpers import CHARM_SERIES, assert_sync_standbys, get_leader_unit, scale_application
16+
from ..helpers import CHARM_BASE, assert_sync_standbys, get_leader_unit, scale_application
1717
from ..juju_ import juju_major_version
1818
from .helpers import (
1919
build_connection_string,
@@ -49,21 +49,21 @@ async def test_deploy_charms(ops_test: OpsTest, charm):
4949
APPLICATION_APP_NAME,
5050
application_name=APPLICATION_APP_NAME,
5151
num_units=2,
52-
series=CHARM_SERIES,
52+
base=CHARM_BASE,
5353
channel="edge",
5454
),
5555
ops_test.model.deploy(
5656
charm,
5757
application_name=DATABASE_APP_NAME,
5858
num_units=1,
59-
series=CHARM_SERIES,
59+
base=CHARM_BASE,
6060
config={"profile": "testing"},
6161
),
6262
ops_test.model.deploy(
6363
charm,
6464
application_name=ANOTHER_DATABASE_APP_NAME,
6565
num_units=2,
66-
series=CHARM_SERIES,
66+
base=CHARM_BASE,
6767
config={"profile": "testing"},
6868
),
6969
)
@@ -218,6 +218,7 @@ async def test_two_applications_doesnt_share_the_same_relation_data(ops_test: Op
218218
APPLICATION_APP_NAME,
219219
application_name=another_application_app_name,
220220
channel="edge",
221+
base=CHARM_BASE,
221222
)
222223
await ops_test.model.wait_for_idle(apps=all_app_names, status="active")
223224

@@ -446,7 +447,7 @@ async def test_admin_role(ops_test: OpsTest):
446447
all_app_names = [DATA_INTEGRATOR_APP_NAME]
447448
all_app_names.extend(APP_NAMES)
448449
async with ops_test.fast_forward():
449-
await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME)
450+
await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME, base=CHARM_BASE)
450451
await ops_test.model.wait_for_idle(apps=[DATA_INTEGRATOR_APP_NAME], status="blocked")
451452
await ops_test.model.applications[DATA_INTEGRATOR_APP_NAME].set_config({
452453
"database-name": DATA_INTEGRATOR_APP_NAME.replace("-", "_"),
@@ -535,7 +536,9 @@ async def test_invalid_extra_user_roles(ops_test: OpsTest):
535536
another_data_integrator_app_name = f"another-{DATA_INTEGRATOR_APP_NAME}"
536537
data_integrator_apps_names = [DATA_INTEGRATOR_APP_NAME, another_data_integrator_app_name]
537538
await ops_test.model.deploy(
538-
DATA_INTEGRATOR_APP_NAME, application_name=another_data_integrator_app_name
539+
DATA_INTEGRATOR_APP_NAME,
540+
application_name=another_data_integrator_app_name,
541+
base=CHARM_BASE,
539542
)
540543
await ops_test.model.wait_for_idle(
541544
apps=[another_data_integrator_app_name], status="blocked"
@@ -592,14 +595,15 @@ async def test_nextcloud_db_blocked(ops_test: OpsTest, charm: str) -> None:
592595
charm,
593596
application_name=DATABASE_APP_NAME,
594597
num_units=1,
595-
series=CHARM_SERIES,
598+
base=CHARM_BASE,
596599
config={"profile": "testing"},
597600
),
598601
ops_test.model.deploy(
599602
"nextcloud",
600603
channel="edge",
601604
application_name="nextcloud",
602605
num_units=1,
606+
base=CHARM_BASE,
603607
),
604608
)
605609
await asyncio.gather(

tests/integration/new_relations/test_relations_coherence.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pytest
1010
from pytest_operator.plugin import OpsTest
1111

12-
from ..helpers import CHARM_SERIES, DATABASE_APP_NAME
12+
from ..helpers import CHARM_BASE, DATABASE_APP_NAME
1313
from .helpers import build_connection_string
1414
from .test_new_relations import DATA_INTEGRATOR_APP_NAME
1515

@@ -29,13 +29,13 @@ async def test_relations(ops_test: OpsTest, charm):
2929
charm,
3030
application_name=DATABASE_APP_NAME,
3131
num_units=1,
32-
series=CHARM_SERIES,
32+
base=CHARM_BASE,
3333
config={"profile": "testing"},
3434
)
3535
await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=3000)
3636

3737
# Creating first time relation with user role
38-
await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME)
38+
await ops_test.model.deploy(DATA_INTEGRATOR_APP_NAME, base=CHARM_BASE)
3939
await ops_test.model.applications[DATA_INTEGRATOR_APP_NAME].set_config({
4040
"database-name": DATA_INTEGRATOR_APP_NAME.replace("-", "_"),
4141
})

0 commit comments

Comments
 (0)