Skip to main content

charmarr-lib-testing

Testing utilities for Charmarr charms.

Features

  • TFManager for Terraform/OpenTofu-based integration testing
  • Jubilant integration for Juju model stabilization
  • Minimal, focused utilities (step definitions added as patterns emerge)

Installation

pip install charmarr-lib-testing

Usage

TFManager

Wrapper around Terraform/OpenTofu for integration tests. Prefers OpenTofu if available.

from pathlib import Path
from charmarr_lib.testing import TFManager

# Initialize with terraform directory
tf = TFManager(Path("./terraform"))
tf.init()

# Apply with environment variables (e.g., for Juju credentials)
tf.apply(env={"TF_VAR_model_name": "my-model"})

# Get outputs
model_name = tf.output("model_name")

# Cleanup
tf.destroy(env={"TF_VAR_model_name": "my-model"})

wait_for_active_idle

Wait for Juju models to stabilize after deployment.

from charmarr_lib.testing import wait_for_active_idle
import jubilant

# Single model
juju = jubilant.Juju()
wait_for_active_idle(juju, timeout=60 * 20)  # 20 minutes

# Multiple models (e.g., cross-model relations)
jujus = [jubilant.Juju(model="model-a"), jubilant.Juju(model="model-b")]
wait_for_active_idle(jujus)

The function:

  1. Waits for all units to be active (with 3 consecutive successes)
  2. Checks for any errors
  3. Waits for all agents to be idle

Metadata

Release files for charmarr-lib-testing 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for charmarr-lib-testing 0.8.1
File Size Uploaded
charmarr_lib_testing-0.8.1.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for charmarr-lib-testing 0.8.1
File Interpreter ABI Platform
charmarr_lib_testing-0.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.7 kB

Release files / charmarr_lib_testing-0.8.1.tar.gz

Download URL charmarr_lib_testing-0.8.1.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e8019780498e3d555d2b6665a04ccd834244bc517ee83197997598f7141326de
BLAKE2b-256 checksum
How to use checksums
7acb2a3849981524ca79b6b2d90b1fc2fb9cf6e3d9bf8c85873b210d709be252
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / charmarr_lib_testing-0.8.1-py3-none-any.whl

Download URL charmarr_lib_testing-0.8.1-py3-none-any.whl
Size 19.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfc53bb80ae78ac7b710a41aad5673dd75755ea6a9059ee4126f1d585e396865
BLAKE2b-256 checksum
How to use checksums
cccdcc838d5e2a448be4eef36869f2cbedc5dbf401976f621c767b2bddcdca52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 release files

0.8.0

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page