Skip to main content

Adapters for Jubilant Charm Testing Library

Project description

jubilant_adapters

PyPI version Ruff Checked with pyright

Jubilant Adapters is a back-to-basics effort to facilitate migration of charm repositories using pytest-operator as their integration testing library, to the newer and better jubilant library. By back-to-basics, I mean pure Gang of Four design patterns, instead of blindly throwing in developers, LLMs and/or agents and burning token, CI and developer budget for something that could be achieved much simpler, with a software engineering mindset.

The way it works is to add jubilant_adpaters as a test dependency, use the JujuFixture provided by that lib as the pivot fixture instead of OpsTest, and simply replace all ops_test calls with juju.ext. I have also included a utility script which does that for you, but it is opinionated and may not work optimally in your particular case. But the general flow remains the same regardless of whether or not you use the utility script.

More on JujuFixture

JujuFixture inherits from jubilant.Juju, and adds an extension layer via the ext property, which provides familiar libjuju-style API on the surface, but uses jubilant on the backend.

So instead of calling ops_test.model.deploy(...), you can call juju.ext.model.deploy(...), and so on.

The adapters may not cover 100% of the libjuju API, and I followed the Pareto rule, coupled with my own experience and judgement to provide adpaters for the most widely used APIs. But feel free to contribute and extend the adapters if you feel something is missing, and I would highly appreciate that!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jubilant_adapters-0.1.3.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jubilant_adapters-0.1.3-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file jubilant_adapters-0.1.3.tar.gz.

File metadata

  • Download URL: jubilant_adapters-0.1.3.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jubilant_adapters-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8a742352f19a8af1ae6568ef05ec253cf588e9500496688dfc0949a1fca7eaf3
MD5 d1563a9566040af940cc904a9ffc5fe8
BLAKE2b-256 a6528a251cf579353f8f7b63657a21f52f06674cb3ec442d536535b4b7cac7cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for jubilant_adapters-0.1.3.tar.gz:

Publisher: publish.yaml on imanenami/jubilant_adapters

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jubilant_adapters-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for jubilant_adapters-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b55430054fc1bbc9ca6ae93f0264e6053eed326c66b766a77cdb4015736b9525
MD5 181bcad184c3f47a5e70e2ea08f5a3de
BLAKE2b-256 2b985411b174fb074397e09e89e8a187ece155b74f441d2d2ba39e9b2acb18f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for jubilant_adapters-0.1.3-py3-none-any.whl:

Publisher: publish.yaml on imanenami/jubilant_adapters

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page