-
Notifications
You must be signed in to change notification settings - Fork 9
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 #34
Comments
I'm hesitant to patch extra names into Container.services because at the moment scenario is using 'native' ops.pebble data structures internally, (Plan, ServiceInfo, etc...) so it'd be unexpected to have a different api in different contexts, when the objects are the same. assert state_out.containers[0].restarted('ausf')
assert state_out.containers[0].replanned
assert state_out.containers[0].sent_signals == ((9, "ausf", "foo"), ("SIGKILL", "bar-server")) @benhoyt WDYT? |
PS in light of #37, probably this kind of container-facing output mocks should end up in |
@tonyandrewmeyer perhaps now we're using our own data structures instead of importing them from ops, this becomes more easy to implement in a clean way? |
You're thinking that the library would offer a ready mock that mirrors the live API, and has some recording functionality. Is that right? |
Moved to canonical/operator#1427 |
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?
The text was updated successfully, but these errors were encountered: