SIENTIAPDE-1005

Implement workflows for fake data generation, scouter processing, and core scouter operations

- Added `FakeData` workflow to generate random data and send it to a Kafka topic.
- Implemented `Scouter` workflow to load data from Kafka and trigger the core scouter workflow.
- Created `CoreScouter` workflow to process data through quality gates, aggregation, and export to PostgreSQL.
- Developed comprehensive unit tests for activities and workflows, ensuring proper functionality and error handling.
- Enhanced Redis and Postgres activities with robust testing for data handling and error notifications.
- Introduced quality filters for data validation and implemented tests to verify their functionality.
This commit is contained in:
vitor-aignosi
2025-05-15 16:53:24 -03:00
parent 4e579dd5bd
commit b203b7d22c
29 changed files with 2070 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
from unittest.mock import MagicMock, patch, ANY
from pytest import fixture
from pytest import fixture, mark
from pandas import DataFrame
from scouter.activities.kafka import Kafka
@@ -38,7 +38,8 @@ def test___init__(kafka_consumer):
)
def test_load_from_kafka(kafka):
@mark.asyncio
async def test_load_from_kafka(kafka):
input_data = {"topic": "test-topic"}
data = [
@@ -55,7 +56,7 @@ def test_load_from_kafka(kafka):
expected = DataFrame([d.value for d in data[0][1]]).to_dict()
result = kafka.load_from_kafka(input_data)
result = await kafka.load_from_kafka(input_data)
assert result == expected