1919# with Crate these terms will supersede the license and you may use the
2020# software solely pursuant to the terms of the relevant commercial agreement.
2121
22- # mypy: disable-error-code="union-attr"
22+ # mypy: disable-error-code="attr-defined, arg-type, union-attr"
2323
2424import logging
2525import time
2626
2727from prometheus_client import REGISTRY
2828
29- from crate .operator .prometheus import ( # type: ignore[attr-defined]
30- PrometheusClusterStatus ,
31- report_cluster_status ,
32- )
29+ from crate .operator .prometheus import PrometheusClusterStatus , report_cluster_status
3330
3431logger = logging .getLogger (__name__ )
3532
@@ -52,15 +49,15 @@ def test_will_report_metrics_for_clusters():
5249 )
5350 cloud_clusters_last_seen = next (
5451 filter (
55- lambda s : s .labels ["cluster_id" ] == "id" , cloud_clusters_last_seen .samples # type: ignore[arg-type] # noqa: E501
52+ lambda s : s .labels ["cluster_id" ] == "id" , cloud_clusters_last_seen .samples
5653 ),
5754 None ,
5855 )
59- assert cloud_clusters_health_sample .value == 0 # type: ignore[attr-defined] # noqa: E501
60- assert cloud_clusters_last_seen .value == last_reported # type: ignore[attr-defined] # noqa: E501
61- assert cloud_clusters_health_sample .labels ["exported_namespace" ] == "ns1" # type: ignore[attr-defined] # noqa: E501
62- assert cloud_clusters_last_seen .labels ["exported_namespace" ] == "ns1" # type: ignore[attr-defined] # noqa: E501
63- assert cloud_clusters_last_seen .labels ["cluster_name" ] == "cluster-name" # type: ignore[attr-defined] # noqa: E501
56+ assert cloud_clusters_health_sample .value == 0
57+ assert cloud_clusters_last_seen .value == last_reported
58+ assert cloud_clusters_health_sample .labels ["exported_namespace" ] == "ns1"
59+ assert cloud_clusters_last_seen .labels ["exported_namespace" ] == "ns1"
60+ assert cloud_clusters_last_seen .labels ["cluster_name" ] == "cluster-name"
6461
6562
6663def test_will_expire_clusters_that_have_not_reported_for_a_while ():
0 commit comments