Skip to content

Conversation

@javiersanchz
Copy link
Member

Description

PR: #33571
The API and framework code were adapted to replace the deprecated datetime-related methods.

Proposed Changes

Unit tests were executed using a Python 3.12 virtual environment to verify the changes:

$ PYTHONPATH=/home/wazuh/Git/wazuh/api:/home/wazuh/Git/wazuh/framework python3 -m pytest framework/wazuh/core/tests/test_utils.py
/home/wazuh/Git/wazuh/venv/lib/python3.12/site-packages/pytest_html/__init__.py:1: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import get_distribution, DistributionNotFound
=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.12.12, pytest-7.3.1, pluggy-1.6.0
rootdir: /home/wazuh/Git/wazuh/framework
configfile: pytest.ini
plugins: anyio-4.1.0, cov-4.1.0, metadata-3.1.1, trio-0.8.0, html-2.1.1, asyncio-0.18.1, tavern-1.23.5
asyncio: mode=Mode.AUTO
collected 305 items                                                                                                                                                                                               

framework/wazuh/core/tests/test_utils.py .................................................................................................................................................................. [ 53%]
...............................................................................................................................................                                                             [100%]

The unit tests related to framework/wazuh/core/cluster/tests/test_master.py are failing due to the error "AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'".
This issue will be addressed in #33572. Once these errors are fixed, the tests will be executed again to verify that the unit tests pass correctly.
In this case, the failures are not related to datetime, so the tests are expected to pass once the asyncio issues are resolved.

Results and Evidence

Manual tests with their corresponding evidence

  • Compilation without warnings on every supported platform
    • Linux
    • Windows
    • MAC OS X
  • Log syntax and correct language review
  • Memory tests for Linux

    • Coverity
    • Valgrind (memcheck and descriptor leaks check)
    • AddressSanitizer
  • Memory tests for Windows

    • Coverity
    • UMDH
  • Memory tests for macOS

    • Leaks
    • AddressSanitizer
  • Decoder/Rule tests (Wazuh v4.x)

    • Added unit testing files ".ini"
    • runtests.py executed without errors
  • Engine (Wazuh v5.x and above)

    • Test run in parallel
    • ASAN for test (utest/ctest)
    • TSAN for test and wazuh-engine.
  • Wazuh server API/Framework

    • Run API Integration Tests

Artifacts Affected

Configuration Changes

Tests Introduced

Review Checklist

  • Code changes reviewed
  • Relevant evidence provided
  • Tests cover the new functionality
  • Configuration changes documented
  • Developer documentation reflects the changes
  • Meets requirements and/or definition of done
  • No unresolved dependencies with other issues
  • ...

@javiersanchz javiersanchz linked an issue Dec 19, 2025 that may be closed by this pull request
3 tasks
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.

Adapt datetime 3.11/3.12 deprecated methods

2 participants