Commit Graph

25 Commits

Author SHA1 Message Date
vitor-aignosi
47e61360ff SIENTIAPDE-1174
Update requirements and refactor manager classes to remove pod_id

- Updated the sientia-dataops-library dependency version to 1.3.8 in requirements.txt.
- Refactored IngestorManager, OpcManager, and ResourceManager classes to remove pod_id from their initialization and internal handling, enhancing code clarity and consistency.
- Adjusted unit tests to reflect the removal of pod_id, ensuring they remain functional and accurate.
2025-08-05 10:59:29 -03:00
vitor-aignosi
cc01a358a9 SIENTIAPDE-1174
Refactor unit tests to improve readability and maintainability

- Updated test assertions and mock setups in test_app.py for clarity.
- Added 'pod_id' to the metadata in test_ingestor.py for consistency.
- Introduced a new test for TAG_WRITTEN_COUNT in test_metrics.py to verify its definition.
- Enhanced test data structure in test_data_manager.py to include additional fields.
2025-07-31 12:03:27 -03:00
vitor-aignosi
9309d7591e SIENTIAPDE-1163
SIENTIAPDE-1163
Refactor Ingestor and DataManager classes to enhance metadata handling

- Updated Ingestor class to include additional metadata fields: 'workflow_name' and 'schema_name'.
- Modified DataManager to accept metadata during initialization.
- Adjusted unit tests to validate the new metadata structure and ensure proper functionality across various managers.
- Removed unused logger initialization in tests for cleaner code.
2025-07-17 14:27:16 -03:00
vitor-aignosi
1a96ada0e0 SIENTIAPDE-1110
Refactor test assertions for improved readability and consistency

- Updated assertions in test cases for DataManager and OpcManager to enhance readability by formatting long lines.
- Ensured that the expected behavior of metrics logging and message publishing is clearly defined in the tests.
2025-07-08 16:24:11 -03:00
vitor-aignosi
750d947d7e Update MongoDB connection handling in DataManager and enhance IngestorManager configuration
- Updated DataManager to simplify MongoDB connection logic by removing retry loop and adding logging for connection attempts.
- Enhanced IngestorManager to accept MongoDB connection parameters and export_to_kafka flag as part of its initialization.
- Updated requirements.txt to use the latest version of the sientia-dataops-library.
2025-07-03 15:35:38 -03:00
vitor-aignosi
a83d4ac728 SIENTIAPDE-1094
Refactor test___init__ to remove unnecessary parameters from notification_handler assertion
2025-06-09 11:30:43 -03:00
Bruno Domingues
6dc304d73d SIENTIAPDE-1083: fix app test 2. 2025-05-30 13:21:53 -03:00
Bruno Domingues
7f9d9aeba5 SIENTIAPDE-1083: fix app test. 2025-05-30 12:40:47 -03:00
Bruno Domingues
0fe2343891 SIENTIAPDE-1083: add prometheus metrics to ingestor_manager. 2025-05-29 17:47:53 -03:00
Bruno Domingues
c49f04ded6 SIENTIAPDE-1083: add prometheus metrics to opc_manager. 2025-05-29 16:52:10 -03:00
Bruno Domingues
03ed5784b1 SIENTIAPDE-1083: add prometheus metrics to resource_manager. 2025-05-29 11:38:57 -03:00
Bruno Domingues
8e332da597 SIENTIAPDE-1083: add prometheus metrics to ingestor. 2025-05-28 17:54:44 -03:00
Bruno Domingues
fff52acf79 SIENTIAPDE-1083: add unit tests for app.py. 2025-05-28 16:15:57 -03:00
Bruno Domingues
12e9151b74 SIENTIAPDE-1083: add unit tests for metrics.py. 2025-05-28 15:42:58 -03:00
vitor-aignosi
c7dbe3585b SIENTIAPDE-1049
Update ingestor and data manager for improved shutdown handling and logging

- Incremented project version in quality gate configuration.
- Commented out ingestor service in docker-compose for clarity.
- Enhanced main loop in app.py to handle exit signals and exceptions.
- Added shutdown methods in Ingestor and DataManager classes for graceful resource cleanup.
- Updated unit tests to validate shutdown behavior and exception handling.
- Introduced coverage configuration to omit specific files.
2025-05-21 09:46:38 -03:00
vitor-aignosi
c868fdae98 Merge branch 'main' into SIENTIAPDE-988-criar-ingestor-opc 2025-05-05 14:58:51 -03:00
Bruno Domingues
2cd0552f1f Configure quality workflow 2. 2025-05-05 11:32:12 -03:00
vitor-aignosi
5f95b6309e SIENTIAPDE-988
Enhance IngestorManager and related tests with notification handling integration

- Added notification_handler parameter to IngestorManager and OpcManager initialization for improved event handling.
- Updated unit tests to include notification_handler in the Ingestor and IngestorManager instantiation, ensuring proper coverage of new functionality.
- Refactored test cases to validate the integration of notification handling across components.
2025-05-05 10:06:05 -03:00
vitor-aignosi
d00078d323 SIENTIAPDE-988
Enhance ingestor and manager classes with notification handling

- Integrated NotificationHandler into Ingestor, DataManager, IngestorManager, and OpcManager for improved error reporting and monitoring.
- Updated methods to send notifications on critical events such as Kafka publishing errors, OPC connection issues, and cycle count warnings.
- Refactored related tests to ensure coverage of new notification functionalities and validate integration with existing components.
- Improved logging and error handling across the system to enhance traceability and operational insights.
2025-04-30 19:28:43 -03:00
vitor-aignosi
da079c6320 SIENTIAPDE-988
Refactor ingestor lease management and update Docker configurations

- Updated CMD in Dockerfile to use the correct application entry point.
- Added docker compose command to remove volumes in README.
- Removed unnecessary restart policy from ingestor service in docker-compose.yaml.
- Refactored manage_leases method in Ingestor class to improve clarity and parameter naming.
- Added get_number_of_leases method in IngestorManager to retrieve active leases.
- Implemented get_all_leases method in ResourceManager to fetch active leases from Redis.
- Enhanced unit tests for lease management in test_ingestor_manager and test_resource_manager.
2025-04-24 08:42:56 -03:00
vitor-aignosi
b9ef69a865 SIENTIAPDE-988
Refactor OpcManager initialization and unsubscribe method; enhance logging

- Removed the `initialize_from_config` method from `OpcManager` class and adjusted the constructor to handle configuration directly.
- Improved the `unsubscribe` method to include detailed logging for non-existent subscriptions.
- Updated tests in `test_opc_manager.py` to reflect changes in the `OpcManager` class.
- Commented out Docker-related fixtures in `conftest.py` for potential future use.
- Enhanced test coverage in `test_single_node.py` and `test_data_manager.py` with additional scenarios and assertions.
- Introduced new methods in `Ingestor` and `IngestorManager` classes to manage server subscriptions and leases more effectively.
- Added new tests for `Ingestor` class to validate initialization and slot management logic.
- Implemented logging improvements across various classes to ensure better traceability of actions and errors.
2025-04-23 18:24:49 -03:00
vitor-aignosi
4208412eca SIENTIAPDE-988
Add temporary functiontal tests, that must be removed soon.

Refactor tests: Remove outdated resource manager tests and add functional tests with Docker and Kafka integration

- Deleted existing unit tests for ResourceManager.
- Introduced new functional tests for single node operations with Redis and Kafka.
- Added Docker Compose setup for test environment.
- Implemented fixtures for Redis and Kafka consumers.
- Created comprehensive tests for data publishing and slot management.
- Added unit tests for DataManager and IngestorManager with mocked dependencies.
- Included tests for OpcManager covering connection, subscription, and data change notifications.
2025-04-22 17:56:54 -03:00
vitor-aignosi
fa51d142e8 SIENTIAPDE-988
Enhance README and Docker setup; improve IngestorManager and DataManager functionality, add error handling, and implement unit tests for OPC initialization and subscription management.
2025-04-17 17:13:13 -03:00
vitor-aignosi
4e919a08be SIENTIAPDE-988 Implement core functionality for OPC ingestor, including main execution flow, IngestorManager methods, and OPC server management. Add unit tests for IngestorManager and OPCManager. 2025-04-16 17:02:26 -03:00
vitor-aignosi
988ee65fbf SIENTIAPDE-988
Implement initial structure for data ingestion with Kafka and OPC UA integration

- Added DataManager for Kafka message handling
- Introduced IngestorManager to manage data ingestion processes
- Created OpcManager for OPC UA client interactions
- Developed ResourceManager for Redis-based resource management
- Established testing framework with unit tests for DataManager and OpcManager
- Configured project settings for Python testing with pytest
2025-04-15 17:00:04 -03:00