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

Add support for testing pebble services interaction #1427

Open
tonyandrewmeyer opened this issue Oct 10, 2024 · 0 comments
Open

Add support for testing pebble services interaction #1427

tonyandrewmeyer opened this issue Oct 10, 2024 · 0 comments
Labels
feature New feature or request needs design needs more thought or spec testing Related to ops.testing

Comments

@tonyandrewmeyer
Copy link
Contributor

There is currently no way in ops-scenario to test a charm interaction with a pebble service, like restarting it for example: self._container.restart(self._service_name).

The only way to accomplish this is to mock ops.model.Container.restart.

It would be nice to have a better way to do this, maybe as an automatic mock in the output state?

...

state_out = self.ctx.run(container.pebble_ready_event, state_in)

assert state_out.containers[0].services["ausf"].restarted

Moved from canonical/ops-scenario#34

@tonyandrewmeyer tonyandrewmeyer added feature New feature or request needs design needs more thought or spec labels Oct 10, 2024
@benhoyt benhoyt added the testing Related to ops.testing label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request needs design needs more thought or spec testing Related to ops.testing
Projects
None yet
Development

No branches or pull requests

2 participants