feat(templates): use Jubilant for integration tests of K8s and machine profiles
Metadata
Current evaluation
Merged PR #2430 as commit 449d3962, switching generated Kubernetes and machine profile integration tests from pytest-operator to Jubilant, with new fixtures and docs.
Resolution: closed resolved
Reason: The approved change was merged as commit 449d3962. It replaced pytest-operator with Jubilant-based integration tests and added temporary Juju model and charm-packing fixtures.
Evaluated by: mr-cal-bot
No scores available.
Issue body
This PR updates the `kubernetes` and `machine` profiles to use the [Jubilant](https://documentation.ubuntu.com/jubilant/) library for integration tests. Main changes:
- Replace pytest-operator by Jubilant in `tests/integration/test_charm.py` and `pyproject.toml`
- Add `tests/integration/conftest.py`, which defines fixtures for creating a temporary Juju model and packing the charm under test
- Docs: update [tests/integration/test_charm.py file](https://canonical-ubuntu-documentation-library--2430.com.readthedocs.build/charmcraft/2430/reference/files/tests-integration-test-charm-py-file/) and add [tests/integration/conftest.py file](https://canonical-ubuntu-documentation-library--2430.com.readthedocs.build/charmcraft/2430/reference/files/tests-integration-conftest-py-file/)
For easier review, here are the charms that `charmcraft init` will produce:
- [Kubernetes charm](https://github.com/dwilding/initial-charms/tree/main/kubernetes-dev-jubilant)
- [Machine charm](https://github.com/dwilding/initial-charms/tree/main/machine-dev-jubilant)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2430 as commit 449d3962, switching generated Kubernetes and machine profile integration tests from pytest-operator to Jubilant, with new fixtures and docs. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged as commit 449d3962 in Charmcraft 4.0. The kubernetes and machine init profile integration tests now use Jubilant/pytest-jubilant instead of pytest-operator, with a new tests/integration/conftest.py and updated docs. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2430; Kubernetes and machine template integration tests now use Jubilant instead of pytest-operator, with new fixtures and updated documentation. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged after four reviewers approved. Replaces pytest-operator with Jubilant for Kubernetes and machine profile integration tests, adds conftest.py fixtures, and updates documentation. CI passed with unrelated test flakiness dismissed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Replaces pytest-operator with Jubilant for Kubernetes and machine profile integration tests. Adds conftest.py with Juju model fixtures, updates templates, and implements CHARM_PATH support to fail tests if the charm is unpacked. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/charmcraft#2623
(confidence 98%)
Merged as 77c4d692, this follow-up updated the same templates to use pytest-jubilant.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2623 feat: update charm templates to use pytest-jubilant | charmcraft | merged | Merged PR #2623 as commit 77c4d692, updating machine and Kubernetes charm templates to use pytest-jubilant for integration tests. | |
| #2769 chore: update pytest logging options in k8s and machine profiles | charmcraft | merged | Merged PR #2769, updating pytest logging options in the k8s and machine profiles to enable Jubilant’s new logging behavior. |