-
Notifications
You must be signed in to change notification settings - Fork 125
Description
Our httpbin charm has a collect-status handler that accounts for various situations, but the unit tests don't cover all cases. The unit tests currently cover:
- The charm going into active status under normal operation
- The charm going into maintenance status if the container can't be reached - as a byproduct of trying to change the config in this situation
Other situations aren't covered. For example, the container is available but we haven't asked Pebble to create a service yet.
Some notes from discussion within Charm Tech:
Generally speaking, we should cover each case of the status reporting. We can consider the status reporting part of the charm's "user interface". It's fine to specifically test the status reporting. In some cases, this will be cleaner than always testing it as a byproduct of some other event. Best practice: Run
update_status, don't runcollect_unit_status.
I'm tracking this as an issue because it would be nice to link to the httpbin unit tests from the Ops docs.