Skip to content

Commit c040672

Browse files
authored
Merge pull request #1158 from james-garner-canonical/24.10/test/fix-local-refresh-integration
#1158 #### Description A recent update to the 'ubuntu' charm requires the use of the v2 metadata format when refreshing from a local charm. The v2 format replaces series with bases, among other changes. Properly supporting this will need to wait on updating python-libjuju to handle bases as well as (or instead of) series -- see issue #1156. In the meantime, fix the test breakage by pinning the install of 'ubuntu' in broken tests to the previous revision (24). This revision has a mismatch with the specification of the "focal" series (20.04), so also bump the series in the local charm to "jammy". #### QA Steps CI tests should now pass again.
2 parents 244e01b + 19381a8 commit c040672

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: charm
2-
series: ["focal"]
2+
series: ["jammy"]
33
summary: "test"
44
description: "test"
55
maintainers: ["test"]

tests/integration/test_application.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,21 @@ async def test_upgrade_charm_resource_same_rev_no_update():
261261
async def test_refresh_charmhub_to_local():
262262
charm_path = INTEGRATION_TEST_DIR / 'charm'
263263
async with base.CleanModel() as model:
264-
app = await model.deploy('ubuntu', application_name='ubu-path')
264+
app = await model.deploy(
265+
'ubuntu',
266+
application_name='ubu-path',
267+
channel='stable',
268+
revision=24, # revision 25 requires v2 format for local charm
269+
)
265270
await app.refresh(path=str(charm_path))
266271
assert app.data['charm-url'].startswith('local:')
267272

268-
app = await model.deploy('ubuntu', application_name='ubu-switch')
273+
app = await model.deploy(
274+
'ubuntu',
275+
application_name='ubu-switch',
276+
channel='stable',
277+
revision=24, # revision 25 requires v2 format for local charm
278+
)
269279
await app.refresh(switch=str(charm_path))
270280
assert app.data['charm-url'].startswith('local:')
271281

@@ -275,7 +285,11 @@ async def test_refresh_charmhub_to_local():
275285
async def test_local_refresh():
276286
charm_path = INTEGRATION_TEST_DIR / 'charm'
277287
async with base.CleanModel() as model:
278-
app = await model.deploy('ubuntu')
288+
app = await model.deploy(
289+
'ubuntu',
290+
channel='stable',
291+
revision=24, # revision 25 requires v2 format for local charm
292+
)
279293
origin = client.CharmOrigin(source="charm-hub", track="20.04", risk="stable",
280294
branch="deadbeef", hash_="hash", id_="id", revision=12,
281295
base=client.Base("20.04", "ubuntu"))

0 commit comments

Comments
 (0)