Hi all! Scenario 4.0 just released with a number of interesting updates!
How to get
pip install ops-scenario==4.0
Added
- Added support for custom events
- Added support for testing actions
Changed
-
State
cleanup: some things that did not quite belong inState
are now lifted toContext
:State.juju_log --> Context.juju_log
State.[unit|app]_status_history --> Context.[unit|app]_status_history
State.workload_version_history --> Context.workload_version_history
-
Status
removed. For the sake of flattening some excessively nested data structures:State.status.app --> State.app_status
State.status.unit --> State.unit_status
State.status.workload_version --> State.workload_version
- The
emitted events
pytest plugin (experimental) is removed and instead one can rely on theContext
to natively and always expose that information. To get a list of all events emitted on the charm during this execution you can getContext.emitted_events
. - Definitely removed support for
trigger()
api.
Bugfixes
- Fixed an issue that would break
from scenario import *
. - Fixed an issue with secret events.
Migrating from scenario 3
Is pretty easy. See how I did that in traefik