ops library 2.6.0 released: Harness.handle_exec, Harness.add_relation improvements, and more

The Charm Tech team has just released version 2.6.0 of ops.

In addition to smaller fixes and features, there are two significant new features in testing.Harness:

  • Add Harness.handle_exec to allow charm tests to simulate Container.exec calls (Pebble one-shot commands) and provide expected output. Thanks @weii-wang for the design and implementation (PR 993).
  • Simplify adding relation units and relation data by adding app_data and unit_data parameters to Harness.add_relation. Previously, charm tests would have to call add_relation followed by add_relation_unit and update_relation_data – now only a single add_relation call is required. Implemented in PR 994.

It’s available from PyPI by using pip install ops, which should pick up the latest version (pin with ops==2.6.0 if you want to pin to a specific version).

Read more in the full release notes on GitHub.

1 Like