def get_status(): status = {} status.update(CronsCheck.run()) status.update(EventsCheck.run()) status.update(HPSearchCheck.run()) status.update(PipelinesCheck.run()) status.update(PostgresCheck.run()) status.update(RabbitMQCheck.run()) status.update(RedisCheck.run()) status.update(SchedulerCheck.run()) status.update(StreamsCheck.run()) return {k: v.to_dict() for k, v in status.items()}
def test_scheduler_not_healthy(self, mock_health): mock_health.side_effect = Exception('Connection Refused') results = SchedulerCheck.run() assert results['SCHEDULER'].is_healthy is False assert results['SCHEDULER'].severity == Result.ERROR
def test_scheduler_wrong_results(self, mock_health): mock_health.return_value.__enter__.return_value = None results = SchedulerCheck.run() assert results['SCHEDULER'].is_healthy is False assert results['SCHEDULER'].severity == Result.WARNING
def test_scheduler_is_healthy(self): results = SchedulerCheck.run() assert results['SCHEDULER'].is_healthy is True