SIENTIAPDE-1325
Enhance release workflow to trigger only on merged pull requests and streamline data insertion in DataManager - Updated the release workflow to execute only when a pull request is merged. - Simplified the document insertion logic in DataManager by consolidating the dictionary construction. - Refactored OPC Manager tests to utilize asynchronous mocks for improved accuracy in testing.
This commit is contained in:
@@ -286,13 +286,13 @@ async def test_update_opc_servers(metrics, opc_manager, ingestor_manager):
|
||||
async def test_check_opc_servers_integrity_all_healthy(metrics, ingestor_manager):
|
||||
# Setup mock OPC managers
|
||||
opc_manager1 = MagicMock()
|
||||
opc_manager1.check_cycles.return_value = None
|
||||
opc_manager1.check_opc_listenning.return_value = False
|
||||
opc_manager1.check_cycles = AsyncMock(return_value=None)
|
||||
opc_manager1.check_opc_listenning = AsyncMock(return_value=False)
|
||||
opc_manager1.config = {'config': 'config1'}
|
||||
|
||||
opc_manager2 = MagicMock()
|
||||
opc_manager2.check_cycles.return_value = None
|
||||
opc_manager2.check_opc_listenning.return_value = False
|
||||
opc_manager2.check_cycles = AsyncMock(return_value=None)
|
||||
opc_manager2.check_opc_listenning = AsyncMock(return_value=False)
|
||||
opc_manager2.config = {'config': 'config2'}
|
||||
|
||||
ingestor_manager.opc_managers = {'server1': opc_manager1, 'server2': opc_manager2}
|
||||
|
||||
@@ -155,8 +155,6 @@ async def test_connect_no_security(client, mock_metrics, raw_opc_manager):
|
||||
[
|
||||
call(
|
||||
metric_object=mock_metrics.OPC_CONNECTIONS_TOTAL,
|
||||
method='inc',
|
||||
value=1,
|
||||
tags={
|
||||
'pod_id': raw_opc_manager.pod_id,
|
||||
'server_name': raw_opc_manager.name,
|
||||
@@ -620,8 +618,6 @@ async def test_check_opc_listenning_error_notification_and_retry(metrics, opc_ma
|
||||
[
|
||||
call(
|
||||
metric_object=metrics.OPC_RECONNECTIONS_TOTAL,
|
||||
method='inc',
|
||||
value=1,
|
||||
tags={
|
||||
'pod_id': opc_manager.pod_id,
|
||||
'server_name': opc_manager.name,
|
||||
|
||||
Reference in New Issue
Block a user