Skip to main content

pytest-jubilant-bdd

GitHub License Matrix

A pytest plugin providing reusable Gherkin step handlers for behavior-driven testing of Juju charmed operators.

pytest-jubilant-bdd is a collection of various utilities that make it easier for you and your friends to write behavior-driven tests for Juju charmed operators. The plugin provides a curated set of reusable Gherkin step handlers built on top of jubilant and pytest-bdd, so you can focus on the behavior of your charms instead of the boilerplate of driving the Juju lifecycle from your tests. Current reusable steps shipped in the pytest-jubilant-bdd package include:

  • add_model: A given step handler for adding a new Juju model to the testing context.
  • add_unit: A given step handler for adding units to a deployed application.
  • deploy: A given step handler for deploying a charm from Charmhub.
  • deploy_local: A given step handler for deploying a local .charm file onto a Juju model.
  • integrate: A given step handler for integrating two Juju applications.
  • model_exists: A given step handler for asserting that a Juju model currently exists.
  • pack_charm: A given step handler for packing a charm from a project directory using charmcraft. Skips packing when the <APP>_CHARM_PATH environment variable is already set.
  • is_integrated: A given step handler for asserting that two applications are currently integrated.
  • is_deployed: A given step handler for asserting that an application is currently deployed on a Juju model.
  • reset_app_config: A given step handler for resetting a configuration option on a deployed application to its default.
  • reset_model_config: A given step handler for resetting a model configuration option to its default.
  • set_app_config: A given step handler for setting a configuration option on a deployed application.
  • set_model_config: A given step handler for setting a configuration option on a Juju model.
  • switch_model: A given step handler for switching the default model that subsequent step handlers operate on.
  • run_action: A when step handler for running a Juju action on one or more units.
  • run_exec: A when step handler for executing a command on one or more machines or units.
  • assert_all_agent_status: A then step handler for asserting the status of all agents in one or more models.
  • assert_workload_status: A then step handler for asserting the workload status of a deployed application.
  • assert_workload_status_message: A then step handler for asserting the message attached to a workload status.

For more information on how to use or contribute to pytest-jubilant-bdd, check out the Development section below 👇

🤔 What's next?

If you want to learn more about all the things you can do with pytest-jubilant-bdd, here are some further resources for you to explore:

🛠️ Development

The project uses just and uv for development, which provides some useful commands that will help you while hacking on pytest-jubilant-bdd:

just fmt          # Apply formatting standards to code
just lint         # Check code against coding style standards
just typecheck    # Run static type checks
just unit         # Run unit tests

If you're interested in contributing your work to pytest-jubilant-bdd, take a look at our contributing guidelines for further details.

🤝 Project and community

pytest-jubilant-bdd is a project of the Ubuntu High-Performance Computing community. Interested in contributing bug fixes, new step handlers, documentation, or feedback? Want to join the Ubuntu HPC community? You’ve come to the right place 🤩

Here’s some links to help you get started with joining the community:

📋 License

pytest-jubilant-bdd is free software, distributed under the Apache License, v2.0. See the LICENSE file for further details.

Download files

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

Source Distribution

pytest_jubilant_bdd-0.6.1.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

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

pytest_jubilant_bdd-0.6.1-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file pytest_jubilant_bdd-0.6.1.tar.gz.

File metadata

  • Download URL: pytest_jubilant_bdd-0.6.1.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pytest_jubilant_bdd-0.6.1.tar.gz
Algorithm Hash digest
SHA256 83a2f242bd83375b7f42c33cc47aeb2a68eda82784ac4268a36b90a5e3cebff7
MD5 dd70c12307e7e1de5133aba9e5f9d63c
BLAKE2b-256 9947a6c32a93770752c7aa1c8e84404714075b05145a0939a5e5ed92e92f4d10

See more details on using hashes here.

File details

Details for the file pytest_jubilant_bdd-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: pytest_jubilant_bdd-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pytest_jubilant_bdd-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f51aefea23cfeaadda795d52d0f6529e61a9b37cc3835cd93019ded28a4f431
MD5 05650ba2c3c62ccbf886927a459202c6
BLAKE2b-256 d84cbc9753fd6d447fe96d2a0f6d10b07bb87ad434b86055f93f6a0df6fefb8d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

This release

0.6.1 This release

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

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