Skip to content

Commit

Permalink
Avoid Test_Metric_Generation_Disabled XPASS if telemetry is not imple…
Browse files Browse the repository at this point in the history
…mented or broken (#2371)
  • Loading branch information
smola authored Apr 24, 2024
1 parent 21b5b97 commit b7914f9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,10 @@ class Test_Metric_Generation_Disabled:
"""Assert that metrics are not reported when metric generation is disabled in telemetry"""

def test_metric_generation_disabled(self):
for data in interfaces.library.get_telemetry_data(flatten_message_batches=True):
if get_request_type(data) == "generate-metrics":
raise Exception("Metric generate event is sent when metric generation is disabled")
all_data = list(interfaces.library.get_telemetry_data(flatten_message_batches=True))
assert len(all_data) != 0, "No telemetry data to validate on"
generate_metrics_messages = [d for d in all_data if get_request_type(d) == "generate-metrics"]
assert len(generate_metrics_messages) == 0, "Metric generation event is sent when metric generation is disabled"


@features.telemetry_metrics_collected
Expand Down

0 comments on commit b7914f9

Please sign in to comment.