Description
I'm working on an upgrade test for a Kubernetes charm, where I'd like to perform the following steps:
- Deploy published version of the charm
- Build charm from source
- Refresh using the locally built charm
Unfortunately, I haven't been able to use libjuju's refresh or local_refresh successfully.
Initially, I tried to run this:
# deploy published version of charm [...]
charm_under_test = await ops_test.build_charm(".")
image_path = METADATA["resources"]["tensorboard-controller-image"]["upstream-source"]
await ops_test.model.applications[APP_NAME].refresh(
path=f"{charm_under_test}", resources={"tensorboard-controller-image": image_path}
)
The above produces the following error:
FAILED tests/integration/test_upgrade.py::test_upgrade - NotImplementedError: resources option is not implemented
Due to the above, I switched to local_refresh instead (using the same syntax), which resulted in the following error:
FAILED tests/integration/test_upgrade.py::test_upgrade - juju.errors.JujuAPIError: missing base name or channel not valid
The full stack trace is this:
Traceback (most recent call last):
File "/home/phoevos/canonical/kubeflow/tensorboards/charms/tensorboard-controller/tests/integration/test_upgrade.py", line 81, in test_upgrade
await ops_test.model.applications[APP_NAME].local_refresh(
File "/home/phoevos/canonical/kubeflow/tensorboards/charms/tensorboard-controller/.tox/integration/lib/python3.8/site-packages/juju/application.py", line 835, in local_refresh
await app_facade.SetCharm(
File "/home/phoevos/canonical/kubeflow/tensorboards/charms/tensorboard-controller/.tox/integration/lib/python3.8/site-packages/juju/client/facade.py", line 483, in wrapper
reply = await f(*args, **kwargs)
File "/home/phoevos/canonical/kubeflow/tensorboards/charms/tensorboard-controller/.tox/integration/lib/python3.8/site-packages/juju/client/_client13.py", line 1638, in SetCharm
reply = await self.rpc(msg)
File "/home/phoevos/canonical/kubeflow/tensorboards/charms/tensorboard-controller/.tox/integration/lib/python3.8/site-packages/juju/client/facade.py", line 656, in rpc
result = await self.connection.rpc(msg, encoder=TypeEncoder)
File "/home/phoevos/canonical/kubeflow/tensorboards/charms/tensorboard-controller/.tox/integration/lib/python3.8/site-packages/juju/client/connection.py", line 628, in rpc
raise errors.JujuAPIError(result)
juju.errors.JujuAPIError: missing base name or channel not valid
Looking at the local_refresh signature, I don't get how I could specify the base there. BTW, refreshing using the Juju CLI works.
Urgency
Annoying bug in our test suite
Python-libjuju version
2.9.42.4
Juju version
2.9.42
Reproduce / Test
Description
I'm working on an upgrade test for a Kubernetes charm, where I'd like to perform the following steps:
Unfortunately, I haven't been able to use libjuju's
refreshorlocal_refreshsuccessfully.Initially, I tried to run this:
The above produces the following error:
Due to the above, I switched to
local_refreshinstead (using the same syntax), which resulted in the following error:The full stack trace is this:
Looking at the
local_refreshsignature, I don't get how I could specify thebasethere. BTW, refreshing using the Juju CLI works.Urgency
Annoying bug in our test suite
Python-libjuju version
2.9.42.4
Juju version
2.9.42
Reproduce / Test