docs/ref/modules/server-api/testing.md
The Server API and Framework use pytest as the test runner. Tests are organized alongside each module.
| Location | Scope |
|---|---|
framework/wazuh/tests/ | Interface layer unit tests |
framework/wazuh/core/tests/ | Core logic unit tests |
api/api/test/ | API layer unit tests |
api/api/controllers/test/ | Controller tests |
framework/wazuh/rbac/tests/ | RBAC unit tests |
framework/wazuh/core/indexer/tests/ | Indexer integration tests |
export WAZUH_REPO=<your_path>
PYTHONPATH=$WAZUH_REPO/framework:$WAZUH_REPO/api pytest framework --disable-warnings
# Interface layer tests
PYTHONPATH=$WAZUH_REPO/framework:$WAZUH_REPO/api pytest framework/wazuh/tests/ --disable-warnings
# Core logic tests
PYTHONPATH=$WAZUH_REPO/framework:$WAZUH_REPO/api pytest framework/wazuh/core/tests/ --disable-warnings
# API layer tests
PYTHONPATH=$WAZUH_REPO/framework:$WAZUH_REPO/api pytest api/api/test/ --disable-warnings
The project uses pytest.ini files for test configuration. These are located at:
framework/pytest.iniapi/api/pytest.ini