Skip to content

Commit 472ea79

Browse files
[DPE-4976] Run tests on juju 3.6 on a nightly schedule (#311)
## Issue We would like to run nightly tests with juju 3.6 ## Solution Upgrade to dpw v21.0.0 and add juju 3.6 into the matrix for tests. Also, upgrade libjuju to ^3.5.2.0
1 parent 27a5975 commit 472ea79

File tree

11 files changed

+54
-37
lines changed

11 files changed

+54
-37
lines changed

.github/workflows/ci.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,20 @@ jobs:
7878
allure_on_amd64: false
7979
- agent: 3.4.3 # renovate: juju-agent-pin-minor
8080
allure_on_amd64: true
81+
- snap_channel: 3.6/beta
82+
allure_on_amd64: false
8183
architecture:
8284
- amd64
8385
include:
8486
- juju:
8587
agent: 3.4.3 # renovate: juju-agent-pin-minor
8688
allure_on_amd64: true
8789
architecture: arm64
88-
name: Integration | ${{ matrix.juju.agent }} | ${{ matrix.architecture }}
90+
- juju:
91+
snap_channel: 3.6/beta
92+
allure_on_amd64: false
93+
architecture: arm64
94+
name: Integration | ${{ matrix.juju.agent || matrix.juju.snap_channel }} | ${{ matrix.architecture }}
8995
needs:
9096
- lint
9197
- unit-test
@@ -95,8 +101,9 @@ jobs:
95101
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
96102
architecture: ${{ matrix.architecture }}
97103
cloud: microk8s
98-
microk8s-snap-channel: 1.28-strict/stable
104+
microk8s-snap-channel: 1.28-strict/stable # renovate: latest microk8s
99105
juju-agent-version: ${{ matrix.juju.agent }}
106+
juju-snap-channel: ${{ matrix.juju.snap_channel }}
100107
libjuju-version-constraint: ${{ matrix.juju.libjuju }}
101108
_beta_allure_report: ${{ matrix.juju.allure_on_amd64 && matrix.architecture == 'amd64' }}
102109
permissions:

lib/charms/tempo_k8s/v1/charm_tracing.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ def _remove_stale_otel_sdk_packages():
224224

225225
_remove_stale_otel_sdk_packages()
226226

227-
228227
import functools
229228
import inspect
230229
import logging
@@ -271,7 +270,7 @@ def _remove_stale_otel_sdk_packages():
271270
# Increment this PATCH version before using `charmcraft publish-lib` or reset
272271
# to 0 if you are raising the major API version
273272

274-
LIBPATCH = 14
273+
LIBPATCH = 15
275274

276275
PYDEPS = ["opentelemetry-exporter-otlp-proto-http==1.21.0"]
277276

@@ -281,7 +280,6 @@ def _remove_stale_otel_sdk_packages():
281280
# set this to 0 if you are debugging/developing this library source
282281
dev_logger.setLevel(logging.CRITICAL)
283282

284-
285283
_CharmType = Type[CharmBase] # the type CharmBase and any subclass thereof
286284
_C = TypeVar("_C", bound=_CharmType)
287285
_T = TypeVar("_T", bound=type)
@@ -333,9 +331,22 @@ def _get_tracer() -> Optional[Tracer]:
333331
try:
334332
return tracer.get()
335333
except LookupError:
334+
# fallback: this course-corrects for a user error where charm_tracing symbols are imported
335+
# from different paths (typically charms.tempo_k8s... and lib.charms.tempo_k8s...)
336336
try:
337337
ctx: Context = copy_context()
338338
if context_tracer := _get_tracer_from_context(ctx):
339+
logger.warning(
340+
"Tracer not found in `tracer` context var. "
341+
"Verify that you're importing all `charm_tracing` symbols from the same module path. \n"
342+
"For example, DO"
343+
": `from charms.lib...charm_tracing import foo, bar`. \n"
344+
"DONT: \n"
345+
" \t - `from charms.lib...charm_tracing import foo` \n"
346+
" \t - `from lib...charm_tracing import bar` \n"
347+
"For more info: https://python-notes.curiousefficiency.org/en/latest/python"
348+
"_concepts/import_traps.html#the-double-import-trap"
349+
)
339350
return context_tracer.get()
340351
else:
341352
return None

poetry.lock

+3-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pytest = "^8.2.2"
5353
pytest-operator = "^0.35.0"
5454
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
5555
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
56-
juju = "^3.2.2"
56+
juju = "^3.5.2.0"
5757
mysql-connector-python = "~8.0.33"
5858
pyyaml = "^6.0.1"
5959
tenacity = "^8.5.0"

tests/integration/test_charm.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ async def test_database_relation(ops_test: OpsTest):
5252
channel="8.0/edge",
5353
application_name=MYSQL_APP_NAME,
5454
config={"profile": "testing"},
55-
series="jammy",
55+
5656
num_units=3,
5757
trust=True, # Necessary after a6f1f01: Fix/endpoints as k8s services (#142)
5858
),
5959
ops_test.model.deploy(
6060
mysqlrouter_charm,
6161
application_name=MYSQL_ROUTER_APP_NAME,
62-
series="jammy",
62+
6363
resources=mysqlrouter_resources,
6464
num_units=1,
6565
trust=True,
@@ -68,7 +68,7 @@ async def test_database_relation(ops_test: OpsTest):
6868
APPLICATION_APP_NAME,
6969
channel="latest/edge",
7070
application_name=APPLICATION_APP_NAME,
71-
series="jammy",
71+
7272
num_units=1,
7373
),
7474
)

tests/integration/test_exporter.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ async def test_exporter_endpoint(ops_test: OpsTest) -> None:
5252
channel="8.0/edge",
5353
application_name=MYSQL_APP_NAME,
5454
config={"profile": "testing"},
55-
series="jammy",
55+
5656
num_units=1,
5757
trust=True,
5858
),
5959
ops_test.model.deploy(
6060
mysqlrouter_charm,
6161
application_name=MYSQL_ROUTER_APP_NAME,
62-
series="jammy",
62+
6363
resources=mysqlrouter_resources,
6464
num_units=1,
6565
trust=True,
@@ -68,14 +68,14 @@ async def test_exporter_endpoint(ops_test: OpsTest) -> None:
6868
APPLICATION_APP_NAME,
6969
channel="latest/edge",
7070
application_name=APPLICATION_APP_NAME,
71-
series="jammy",
71+
7272
num_units=1,
7373
),
7474
ops_test.model.deploy(
7575
GRAFANA_AGENT_APP_NAME,
7676
application_name=GRAFANA_AGENT_APP_NAME,
7777
num_units=1,
78-
series="jammy",
78+
7979
channel="latest/stable",
8080
),
8181
)

tests/integration/test_exporter_with_tls.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ async def test_exporter_endpoint(ops_test: OpsTest) -> None:
6868
channel="8.0/edge",
6969
application_name=MYSQL_APP_NAME,
7070
config={"profile": "testing"},
71-
series="jammy",
71+
7272
num_units=1,
7373
trust=True,
7474
),
7575
ops_test.model.deploy(
7676
mysqlrouter_charm,
7777
application_name=MYSQL_ROUTER_APP_NAME,
78-
series="jammy",
78+
7979
resources=mysqlrouter_resources,
8080
num_units=1,
8181
trust=True,
@@ -84,14 +84,14 @@ async def test_exporter_endpoint(ops_test: OpsTest) -> None:
8484
APPLICATION_APP_NAME,
8585
channel="latest/edge",
8686
application_name=APPLICATION_APP_NAME,
87-
series="jammy",
87+
8888
num_units=1,
8989
),
9090
ops_test.model.deploy(
9191
GRAFANA_AGENT_APP_NAME,
9292
application_name=GRAFANA_AGENT_APP_NAME,
9393
num_units=1,
94-
series="jammy",
94+
9595
channel="latest/stable",
9696
),
9797
)
@@ -141,7 +141,7 @@ async def test_exporter_endpoint(ops_test: OpsTest) -> None:
141141
application_name=tls_app_name,
142142
channel=tls_channel,
143143
config=tls_config,
144-
series="jammy",
144+
145145
)
146146

147147
await ops_test.model.wait_for_idle([tls_app_name], status="active", timeout=SLOW_TIMEOUT)

tests/integration/test_log_rotation.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ async def test_log_rotation(ops_test: OpsTest):
5353
channel="8.0/edge",
5454
application_name=MYSQL_APP_NAME,
5555
config={"profile": "testing"},
56-
series="jammy",
56+
5757
num_units=3,
5858
trust=True, # Necessary after a6f1f01: Fix/endpoints as k8s services (#142)
5959
),
6060
ops_test.model.deploy(
6161
mysqlrouter_charm,
6262
application_name=MYSQL_ROUTER_APP_NAME,
63-
series="jammy",
63+
6464
resources=mysqlrouter_resources,
6565
num_units=1,
6666
trust=True,
@@ -69,7 +69,7 @@ async def test_log_rotation(ops_test: OpsTest):
6969
APPLICATION_APP_NAME,
7070
channel="latest/edge",
7171
application_name=APPLICATION_APP_NAME,
72-
series="jammy",
72+
7373
num_units=1,
7474
),
7575
)

tests/integration/test_node_port.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ async def test_build_and_deploy(ops_test: OpsTest):
6262
channel="8.0/edge",
6363
application_name=MYSQL_APP_NAME,
6464
config={"profile": "testing"},
65-
series="jammy",
65+
6666
num_units=3,
6767
trust=True, # Necessary after a6f1f01: Fix/endpoints as k8s services (#142)
6868
),
6969
ops_test.model.deploy(
7070
mysqlrouter_charm,
7171
application_name=MYSQL_ROUTER_APP_NAME,
72-
series="jammy",
72+
7373
resources=mysqlrouter_resources,
7474
num_units=1,
7575
trust=True,
@@ -78,14 +78,14 @@ async def test_build_and_deploy(ops_test: OpsTest):
7878
APPLICATION_APP_NAME,
7979
channel="latest/edge",
8080
application_name=APPLICATION_APP_NAME,
81-
series="jammy",
81+
8282
num_units=1,
8383
),
8484
ops_test.model.deploy(
8585
DATA_INTEGRATOR,
8686
channel="latest/edge",
8787
application_name=DATA_INTEGRATOR,
88-
series="jammy",
88+
8989
config={"database-name": "test"},
9090
num_units=1,
9191
),
@@ -94,7 +94,7 @@ async def test_build_and_deploy(ops_test: OpsTest):
9494
channel=tls_channel,
9595
application_name=SELF_SIGNED_CERTIFICATE_NAME,
9696
config=TLS_CONFIG,
97-
series="jammy",
97+
9898
num_units=1,
9999
),
100100
)

tests/integration/test_tls.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async def test_build_deploy_and_relate(ops_test: OpsTest) -> None:
6060
channel="8.0/edge",
6161
application_name=MYSQL_APP_NAME,
6262
config={"profile": "testing"},
63-
series="jammy",
63+
6464
num_units=1,
6565
trust=True,
6666
)
@@ -73,7 +73,7 @@ async def test_build_deploy_and_relate(ops_test: OpsTest) -> None:
7373
ops_test.model.deploy(
7474
mysqlrouter_charm,
7575
application_name=MYSQL_ROUTER_APP_NAME,
76-
series="jammy",
76+
7777
resources=mysqlrouter_resources,
7878
num_units=1,
7979
trust=True,
@@ -83,13 +83,13 @@ async def test_build_deploy_and_relate(ops_test: OpsTest) -> None:
8383
application_name=tls_app_name,
8484
channel=tls_channel,
8585
config=tls_config,
86-
series="jammy",
86+
8787
),
8888
ops_test.model.deploy(
8989
TEST_APP_NAME,
9090
application_name=TEST_APP_NAME,
9191
channel="latest/edge",
92-
series="jammy",
92+
9393
),
9494
)
9595

tests/integration/test_upgrade.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,23 @@ async def test_deploy_edge(ops_test: OpsTest) -> None:
5252
channel="8.0/edge",
5353
application_name=MYSQL_APP_NAME,
5454
config={"profile": "testing"},
55-
series="jammy",
55+
5656
num_units=1,
5757
trust=True, # Necessary after a6f1f01: Fix/endpoints as k8s services (#142)
5858
),
5959
ops_test.model.deploy(
6060
MYSQL_ROUTER_APP_NAME,
6161
channel="8.0/edge",
6262
application_name=MYSQL_ROUTER_APP_NAME,
63-
series="jammy",
63+
6464
num_units=3,
6565
trust=True,
6666
),
6767
ops_test.model.deploy(
6868
APPLICATION_APP_NAME,
6969
channel="latest/edge",
7070
application_name=APPLICATION_APP_NAME,
71-
series="jammy",
71+
7272
num_units=1,
7373
),
7474
)

0 commit comments

Comments
 (0)