Skip to content

Commit b18062d

Browse files
[DPE-4976] Add workflow for nightly scheduled tests with juju 3.6 (#490)
* Add temporary CI file to run juju 3.6 tests on branch PR * Explicitly use base instead of series, and hardcode base as [email protected] * Add --base to a missed deploy command * Use channel 3/stable for kafka-k8s and zookeeper-k8s charms * Revert kafka and zookeeper to use latest/stable with base [email protected] * Merge juju 3.6 workflow file into CI workflow file + upgrade to dpw v21.0.0 * Update outdated charm_tracing charm lib * Avoid setting revision for mongodb-k8s * Revert deployment of mongodb-k8s in mysql_root test * Use --base or --series based on juju version in test_mysql_root
1 parent 52df626 commit b18062d

16 files changed

+87
-43
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,32 @@ jobs:
7070
allure_on_amd64: false
7171
- agent: 3.4.5 # renovate: juju-agent-pin-minor
7272
allure_on_amd64: true
73+
- snap_channel: 3.6/beta
74+
allure_on_amd64: false
7375
architecture:
7476
- amd64
7577
include:
7678
- juju:
7779
agent: 3.4.5 # renovate: juju-agent-pin-minor
7880
allure_on_amd64: true
7981
architecture: arm64
80-
name: Integration | ${{ matrix.juju.agent }} | ${{ matrix.architecture }}
82+
- juju:
83+
snap_channel: 3.6/beta
84+
allure_on_amd64: false
85+
architecture: arm64
86+
name: Integration | ${{ matrix.juju.agent || matrix.juju.snap_channel }} | ${{ matrix.architecture }}
8187
needs:
8288
- lint
8389
- unit-test
8490
- build
85-
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v20.0.2
91+
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v21.0.0
8692
with:
8793
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
8894
architecture: ${{ matrix.architecture }}
8995
cloud: microk8s
90-
microk8s-snap-channel: 1.28-strict/stable
96+
microk8s-snap-channel: 1.28-strict/stable # renovate: latest microk8s
9197
juju-agent-version: ${{ matrix.juju.agent }}
98+
juju-snap-channel: ${{ matrix.juju.snap_channel }}
9299
libjuju-version-constraint: ${{ matrix.juju.libjuju }}
93100
_beta_allure_report: ${{ matrix.juju.allure_on_amd64 && matrix.architecture == 'amd64' }}
94101
secrets:

lib/charms/tempo_k8s/v1/charm_tracing.py

Lines changed: 14 additions & 3 deletions
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

Lines changed: 11 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ parameterized = "^0.9.0"
5050

5151
[tool.poetry.group.integration.dependencies]
5252
pytest = "^7.4.0"
53-
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v20.0.2", subdirectory = "python/pytest_plugins/github_secrets"}
53+
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.0", subdirectory = "python/pytest_plugins/github_secrets"}
5454
pytest-microceph = {git = "https://github.com/canonical/data-platform-workflows", tag = "v20.0.2", subdirectory = "python/pytest_plugins/microceph"}
5555
pytest-operator = "^0.28.0"
56-
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v20.0.2", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
57-
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v20.0.2", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
58-
juju = "^3.2.2"
56+
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
57+
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
58+
juju = "^3.5.2.0"
5959
ops = "^2.15.0"
6060
mysql-connector-python = "~8.0.33"
6161
tenacity = "^8.2.2"
@@ -65,7 +65,7 @@ urllib3 = "^1.26.16"
6565
lightkube = "^0.14.0"
6666
kubernetes = "^27.2.0"
6767
allure-pytest = "^2.13.2"
68-
allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v20.0.2", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"}
68+
allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.0", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"}
6969
pytest-asyncio = "^0.21.1"
7070

7171
[tool.coverage.run]

tests/integration/high_availability/high_availability_helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ async def deploy_and_scale_mysql(
160160
config=config,
161161
resources=resources,
162162
num_units=num_units,
163-
series="jammy",
163+
164164
trust=True,
165165
)
166166

@@ -198,6 +198,7 @@ async def deploy_and_scale_application(ops_test: OpsTest) -> str:
198198
application_name=APPLICATION_DEFAULT_APP_NAME,
199199
num_units=1,
200200
channel="latest/edge",
201+
201202
)
202203

203204
await ops_test.model.wait_for_idle(

tests/integration/high_availability/test_async_replication.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ async def test_build_and_deploy(
9090
config=config,
9191
resources=resources,
9292
trust=True,
93+
9394
)
9495
config["cluster-name"] = "cuzco"
9596
await second_model.deploy(
@@ -99,6 +100,7 @@ async def test_build_and_deploy(
99100
config=config,
100101
resources=resources,
101102
trust=True,
103+
102104
)
103105

104106
logger.info("Waiting for the applications to settle")
@@ -193,15 +195,15 @@ async def test_deploy_router_and_app(first_model: Model) -> None:
193195
await first_model.deploy(
194196
MYSQL_ROUTER_APP_NAME,
195197
application_name=MYSQL_ROUTER_APP_NAME,
196-
series="jammy",
198+
197199
channel="8.0/edge",
198200
num_units=1,
199201
trust=True,
200202
)
201203
await first_model.deploy(
202204
APPLICATION_APP_NAME,
203205
application_name=APPLICATION_APP_NAME,
204-
series="jammy",
206+
205207
channel="latest/edge",
206208
num_units=1,
207209
)

tests/integration/high_availability/test_upgrade.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ async def test_deploy_latest(ops_test: OpsTest) -> None:
4646
channel="8.0/edge",
4747
trust=True,
4848
config={"profile": "testing"},
49+
4950
)
5051
await ops_test.model.deploy(
5152
TEST_APP_NAME,
5253
application_name=TEST_APP_NAME,
5354
num_units=1,
5455
channel="latest/edge",
56+
5557
)
5658

5759
await relate_mysql_and_application(ops_test, MYSQL_APP_NAME, TEST_APP_NAME)

tests/integration/high_availability/test_upgrade_from_stable.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ async def test_deploy_stable(ops_test: OpsTest) -> None:
4343
channel="8.0/stable",
4444
trust=True,
4545
config={"profile": "testing"},
46+
4647
),
4748
ops_test.model.deploy(
4849
f"mysql-{TEST_APP_NAME}",
4950
application_name=TEST_APP_NAME,
5051
num_units=1,
5152
channel="latest/edge",
53+
5254
),
5355
)
5456
await relate_mysql_and_application(ops_test, MYSQL_APP_NAME, TEST_APP_NAME)

tests/integration/high_availability/test_upgrade_rollback_incompat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
4747
num_units=3,
4848
resources=resources,
4949
trust=True,
50+
5051
)
5152

5253
await ops_test.model.wait_for_idle(

tests/integration/relations/test_database.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ async def test_build_and_deploy(ops_test: OpsTest):
4444
config=config,
4545
num_units=3,
4646
resources=resources,
47-
series="jammy",
47+
4848
trust=True,
4949
),
5050
ops_test.model.deploy(
5151
APPLICATION_APP_NAME,
5252
application_name=APPLICATION_APP_NAME,
5353
num_units=2,
5454
channel="latest/edge",
55+
5556
),
5657
)
5758

0 commit comments

Comments
 (0)