Skip to content

Commit

Permalink
add test to check if error output healthcheck is added to exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrai2 committed Oct 28, 2024
1 parent 99b393b commit 4db7e73
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/unit/framework/test_pipeline_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,19 @@ def test_restart_failed_pipelines_sets_old_pipeline_index(self):
pipeline_manager.restart_failed_pipeline()
mock_create_pipeline.assert_called_once_with(1)

def test_restart_failed_pipeline_adds_error_output_health_check_to_metrics_exporter(
self, tmp_path
):
with mock.patch("logprep.framework.pipeline_manager.OutputQueueListener"):
with mock.patch("logprep.framework.pipeline_manager.ThrottlingQueue"):
config = deepcopy(self.config)
config.error_output = {"dummy": {"type": "dummy_output"}}
pipeline_manager = PipelineManager(config)
mock_export = mock.MagicMock()
pipeline_manager.prometheus_exporter = mock_export
pipeline_manager.restart()
mock_export.update_healthchecks.assert_called()

def test_pipeline_manager_sets_queue_size_for_http_input(self):
config = deepcopy(self.config)
config.input = {
Expand Down

0 comments on commit 4db7e73

Please sign in to comment.