Skip to content

Conversation

@Enaraque
Copy link
Member

Description

The purpose of this PR is to add the first module of the new Installation Assistant: the Config Manager. Alongside this module, the pyproject.toml is included to initialize the project, as well as the logger that will be used.

The pyproject.toml defines the project dependencies and the different Hatch environments that can be used during development. The idea is that, once completed, the project can be easily built with Hatch using the configuration defined in the pyproject.

The Config Manager is responsible for retrieving information about each component and node defined in the config.yaml.

Tests 🧪

You can find different executions of the Config Manager in a comment in the related issue: #336 (comment)

A test module has also been created, which will be extended as new features are added to the project. For now, unit tests have been added for both the Config Manager and the logger.

You can run the tests with:

hatch run dev:test-cov

This will install the required dependencies and print a summary of the test execution along with the test coverage percentage. In this case, the obtained coverage is 100%:

tests summary
hatch run dev:test-cov
================================================================================== test session starts ===================================================================================
platform linux -- Python 3.12.2, pytest-8.3.5, pluggy-1.6.0
rootdir: /home/henry/work-wazuh/wazuh-repos/wazuh-installation-assistant
configfile: pyproject.toml
plugins: cov-6.1.1, xdist-3.6.1
4 workers [43 items]    
...........................................                                                                                                                                        [100%]
===================================================================================== tests coverage =====================================================================================
____________________________________________________________________ coverage: platform linux, python 3.12.2-final-0 _____________________________________________________________________

Name    Stmts   Miss  Cover   Missing
-------------------------------------
TOTAL     116      0   100%

2 files skipped due to complete coverage.
Coverage XML written to file coverage.xml

Important

A test module already existed in the project. It has been renamed to old_tests, and its references have been updated accordingly.

@Enaraque Enaraque requested a review from a team May 23, 2025 15:16
@Enaraque Enaraque self-assigned this May 23, 2025
@c-bordon c-bordon merged commit bac221f into 6.0.0 May 26, 2025
@c-bordon c-bordon deleted the enhancement/336-development---installation-assistant---create-the-config-manager-to-handle-the-configyml-file branch May 26, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Development - Installation Assistant - Create the Config Manager to Handle the config.yml File

4 participants