← Back to issue list

feat(templates): use Jubilant for integration tests of K8s and machine profiles

View original Github issue

Metadata

Project
charmcraft
Number
#2430
Type
pull request
State
merged
Author
dwilding
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action:

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
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.
qwen3.6-35b-a3b-mtp-q6 Merged. Replaced pytest-operator with Jubilant for Kubernetes and machine charm integration tests. Added conftest.py fixtures, updated documentation, and configured tests to depend on CHARM_PATH. CI failures were unrelated flakiness.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2623 feat: update charm templates to use pytest-jubilant charmcraft merged Merged to main. Updates machine and Kubernetes charm templates to use pytest-jubilant, aligning with parallel Ops documentation changes. Approved by three reviewers and integrated after CI validation.
79%
#2401 feat(test): add testing profiles for init command charmcraft merged Merged. Adds test-machine and test-kubernetes profiles to the init command for charmcraft test. Fixes #2365. Approved by three reviewers despite failing CI checks. Future updates will integrate jubilant and expand profiles.
72%