Right now, the _get_app_relation_data and the _get_unit_relation_data are getting relation data from relation and endpoint defined in the charm. So if charm has "logging" endpoint defined in requires relations, those function will return application/unit data defined in required side of relation.
In our case, we need to get unit relation data from provides side of "logging" relation, so that's why assert_logging needs to be called with Grafana agent.
It is not very user-friendly, since all other assert functions are called with tested app, that's why I think we should add option to get application/unit data from either side of relation.
Calling assert_logging with tested app will also prevent raising an exception if grafana-agent-k8s is related with multiple application with logging endpoint.
What needs to get done
assert_logging should be called with tested app, instead of Grafana agent
_get_app_relation_data and _get_unit_relation_data should be able to get data from both side of relation
Definition of Done
_get_app_relation_data and _get_unit_relation_data has argument for choosing side of relation
Context
Right now, the
_get_app_relation_data
and the_get_unit_relation_data
are getting relation data from relation and endpoint defined in the charm. So if charm has "logging" endpoint defined in requires relations, those function will return application/unit data defined in required side of relation.In our case, we need to get unit relation data from
provides
side of "logging" relation, so that's whyassert_logging
needs to be called with Grafana agent.It is not very user-friendly, since all other assert functions are called with tested app, that's why I think we should add option to get application/unit data from either side of relation.
Calling
assert_logging
with tested app will also prevent raising an exception if grafana-agent-k8s is related with multiple application with logging endpoint.What needs to get done
Definition of Done