Since we'll be adding support for observability to all charms, we'll need to test that as well. These tests should be the same in each charm, and that's why an abstraction should be added to chisme. Such abstraction will require the following steps:
Deploy, relate and assert the grafana-agent-k8s
it will be deployed in the test model along the charm
it will be related only to the tested charm, so there will be cos deployment
since cos relation will be missing, the grafana-agent-k8s will be in blocked state
Check metrics-endpoint and grafana-dashboards-consumer relation endpoint data bags
We need to be able to verify that data bags contains all data needed. e.g. dashboards, scrape_jobs, alert_rules
get_alert_rules_from_charm - helper function to collect all alert rules in charm
get_grafana_dashboards_from_charm - helper function to collect all dashboard in charm
check_grafana_dashboard_relation_data
check_metrics_endpoint_relation_data
...
Check metrics endpoint is accessible
This function should check if <workload-k8s-service>:<metrics-port><metrics-path> returns code 200, i.e. that the endpoint is available.
What needs to get done
Add function to deploy, relate, ... grafana-agent-k8s to tested charm.
Add function to verify that metrics-endpoint data bags contains all data.
Add function to verify that grafana-dashboards-consumer data bags contains all data.
Add function to verify accessibility of metrics endpoint.
Definition of Done
All function above was implemented.
All function was tested.
The integration test was added, or we tested in with single charm.
Context
Since we'll be adding support for observability to all charms, we'll need to test that as well. These tests should be the same in each charm, and that's why an abstraction should be added to chisme. Such abstraction will require the following steps:
<workload-k8s-service>:<metrics-port><metrics-path>
returns code 200, i.e. that the endpoint is available.What needs to get done
Definition of Done