Merge pull request #12 from Aignosi/SIENTIAPDE-1151-criar-testes-de-stress

Sientiapde 1151 criar testes de stress
This commit is contained in:
Bruno Domingues
2025-07-22 12:22:15 -03:00
committed by GitHub
6 changed files with 14 additions and 3 deletions

View File

@@ -192,6 +192,10 @@ class Gates(BaseActivity):
metadata=metadata metadata=metadata
) )
tags = list(model_tags.keys())
data = data[data['name'].isin(tags)]
for filter_name, config in filters.items(): for filter_name, config in filters.items():
policy = config['policy'] policy = config['policy']
if filter_name not in quality_gate_filters: if filter_name not in quality_gate_filters:

View File

@@ -112,6 +112,11 @@ class MongoDB(BaseActivity):
data = clear_mongo_id(data) data = clear_mongo_id(data)
self.debug(
f"Collected: {data}",
metadata=metadata
)
for item in data: for item in data:
item['inserted_at'] = item['inserted_at'].strftime( item['inserted_at'] = item['inserted_at'].strftime(
"%Y-%m-%d %H:%M:%S.%f") "%Y-%m-%d %H:%M:%S.%f")

View File

@@ -75,7 +75,7 @@ class Redis(RedisBase):
) )
try: try:
self.set(key, last_data_timestamp, ttl=None) self.set(key, last_data_timestamp, ttl=60*60*5)
except Exception as e: except Exception as e:
self.send_notification( self.send_notification(
metadata=metadata, metadata=metadata,

View File

@@ -37,6 +37,7 @@ async def test_data_quality_gate_with_null_values_filter_discard(gates_fixture):
} }
}, },
'data': { 'data': {
'name': ['tag1', 'tag2', 'tag3'],
'tag': ['tag1', 'tag2', 'tag3'], 'tag': ['tag1', 'tag2', 'tag3'],
'value': [1.0, None, 3.0], 'value': [1.0, None, 3.0],
'timestamp': ['2023-01-01', '2023-01-02', '2023-01-03'], 'timestamp': ['2023-01-01', '2023-01-02', '2023-01-03'],
@@ -69,6 +70,7 @@ async def test_data_quality_gate_with_out_of_bounds_filter_keep(gates_fixture):
} }
}, },
'data': { 'data': {
'name': ['tag1', 'tag2', 'tag3'],
'tag': ['tag1', 'tag2', 'tag3'], 'tag': ['tag1', 'tag2', 'tag3'],
'value': [1.0, 200.0, 3.0], 'value': [1.0, 200.0, 3.0],
'timestamp': ['2023-01-01', '2023-01-02', '2023-01-03'] 'timestamp': ['2023-01-01', '2023-01-02', '2023-01-03']

View File

@@ -164,7 +164,7 @@ async def test_put_last_data_timestamp_not_empty_dataframe(redis_activity):
redis_activity.set.assert_called_once_with( redis_activity.set.assert_called_once_with(
'last_data_timestamp_test_pipeline_test_schedule', 'last_data_timestamp_test_pipeline_test_schedule',
'2023-01-01 12:00:01', '2023-01-01 12:00:01',
ttl=None ttl=18000
) )

View File

@@ -118,7 +118,7 @@ env:
- name: GITHUB_REPO_URL - name: GITHUB_REPO_URL
value: "git@github.com:Aignosi/sientia-dataops-scouter_temporal.git" value: "git@github.com:Aignosi/sientia-dataops-scouter_temporal.git"
- name: GITHUB_BRANCH - name: GITHUB_BRANCH
value: "SIENTIAPDE-1163-alterar-dinamica-de-notificacoes-para-usar-o-mongodb-ao-inves-do-kafka" value: "SIENTIAPDE-1151-criar-testes-de-stress"
- name: PYTHON_APP - name: PYTHON_APP
value: "scouter.worker.worker" value: "scouter.worker.worker"