Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove scripts #77

Merged
merged 7 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1283,25 +1283,10 @@ If you have a clear false negative, are explicitly testing 'edge', inconsistent
checker is in your way, you can set the `SCENARIO_SKIP_CONSISTENCY_CHECKS` envvar and skip it altogether. Hopefully you
don't need that.

# Snapshot
# Jhack integrations

Scenario comes with a cli tool called `snapshot`. Assuming you've pip-installed `ops-scenario`, you should be able to
reach the entry point by typing `scenario snapshot` in a shell so long as the install dir is in your `PATH`.
Up until `v5.6.0`, `scenario` shipped with a cli tool called `snapshot`, used to interact with a live charm's state.
The functionality [has been moved over to `jhack`](https://github.com/PietroPasotti/jhack/pull/111),
to allow us to keep working on it independently, and to streamline
the profile of `scenario` itself as it becomes more broadly adopted and ready for widespread usage.

Snapshot's purpose is to gather the `State` data structure from a real, live charm running in some cloud your local juju
client has access to. This is handy in case:

- you want to write a test about the state the charm you're developing is currently in
- your charm is bork or in some inconsistent state, and you want to write a test to check the charm will handle it
correctly the next time around (aka regression testing)
- you are new to Scenario and want to quickly get started with a real-life example.

Suppose you have a Juju model with a `prometheus-k8s` unit deployed as `prometheus-k8s/0`. If you type
`scenario snapshot prometheus-k8s/0`, you will get a printout of the State object. Pipe that out into some file, import
all you need from `scenario`, and you have a working `State` that you can `Context.run` events with.

You can also pass a `--format` flag to obtain instead:

- a jsonified `State` data structure, for portability
- a full-fledged pytest test case (with imports and all), where you only have to fill in the charm type and the event
that you wish to trigger.
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "ops-scenario"

version = "5.6"
version = "5.6.1"
PietroPasotti marked this conversation as resolved.
Show resolved Hide resolved

authors = [
{ name = "Pietro Pasotti", email = "pietro.pasotti@canonical.com" }
Expand Down Expand Up @@ -39,8 +39,6 @@ classifiers = [
"Homepage" = "https://github.com/canonical/ops-scenario"
"Bug Tracker" = "https://github.com/canonical/ops-scenario/issues"

[project.scripts]
scenario = "scenario.scripts.main:main"

[tool.setuptools.package-dir]
scenario = "scenario"
Expand Down
17 changes: 0 additions & 17 deletions scenario/scripts/errors.py

This file was deleted.

17 changes: 0 additions & 17 deletions scenario/scripts/logger.py

This file was deleted.

57 changes: 0 additions & 57 deletions scenario/scripts/main.py

This file was deleted.

Loading