Wazuh assistant unit and integration test#630
Merged
Conversation
🧪 Unit Tests Results✅ All tests passed! Summary
📊 Coverage Details |
…tion-tests Signed-off-by: Federico Caffieri <89791732+fcaffieri@users.noreply.github.com>
… of https://github.com/wazuh/wazuh-installation-assistant into enhancement/589-wazuh-passwords-tool-integration-tests
This was referenced Mar 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Python/pytest-based unit test suite for the Bash-based Wazuh Installation Assistant tools, while preserving the legacy Bach/Docker tests for reference and updating CI workflows to execute the new test suite and improve integration test execution.
Changes:
- Add pytest unit tests that execute Bash functions via
subprocesswith injected mocks. - Add
pyproject.toml+ updatedtests/unit/README.mdto standardize local/CI test execution via Hatch/pytest. - Update GitHub Actions workflows to run unit tests with coverage reporting and to reuse built tool artifacts across integration test OS matrices.
Reviewed changes
Copilot reviewed 14 out of 27 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit/conftest.py |
Adds the shared Bash-function runner and assertion helpers for pytest. |
tests/unit/test_*.py |
Adds unit tests for installer components (checks/common/certs/passwords/indexer/manager/dashboard). |
tests/unit/README.md |
Replaces legacy Docker instructions with pytest/Hatch-based guidance and explains the mocking approach. |
tests/unit/legacy/** |
Preserves the old Bach/Docker unit test harness and suites as “legacy”. |
pyproject.toml |
Adds Hatch + pytest configuration for unit test execution. |
.github/workflows/check_unit_tests.yaml |
Adds a CI workflow to run pytest via Hatch and comment results on PRs. |
.github/workflows/check_integration_tools.yaml |
Refactors integration workflow to build once and test across an OS matrix using uploaded artifacts. |
.gitignore |
Ignores virtualenvs and Python bytecode/coverage artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
c-bordon
approved these changes
Mar 17, 2026
Enaraque
approved these changes
Mar 17, 2026
CarlosALgit
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Releated
Tests
Unit: https://github.com/wazuh/wazuh-installation-assistant/actions/runs/23168428281?pr=630
Integration:
RedHat 10 AMD
Devops Integration Tests Results
Summary for PASSWORDS-TOOL
Status: PASS 🟢
Passed Tests
Assistant
Assistant: New password accepted by indexer 🟢
Assistant: New password accepted by dashboard 🟢
Assistant: Old password rejected 🟢
Assistant: Wazuh manager api reachable 🟢
RedHat 10 ARM
Devops Integration Tests Results
Summary for PASSWORDS-TOOL
Status: PASS 🟢
Passed Tests
Assistant
Assistant: New password accepted by indexer 🟢
Assistant: New password accepted by dashboard 🟢
Assistant: Old password rejected 🟢
Assistant: Wazuh manager api reachable 🟢
RedHat 9 AMD
Devops Integration Tests Results
Summary for PASSWORDS-TOOL
Status: PASS 🟢
Passed Tests
Assistant
Assistant: New password accepted by indexer 🟢
Assistant: New password accepted by dashboard 🟢
Assistant: Old password rejected 🟢
Assistant: Wazuh manager api reachable 🟢
RedHat 9 ARM
Devops Integration Tests Results
Summary for PASSWORDS-TOOL
Status: PASS 🟢
Passed Tests
Assistant
Assistant: New password accepted by indexer 🟢
Assistant: New password accepted by dashboard 🟢
Assistant: Old password rejected 🟢
Assistant: Wazuh manager api reachable 🟢
Ubuntu 22 AMD
Devops Integration Tests Results
Summary for PASSWORDS-TOOL
Status: PASS 🟢
Passed Tests
Assistant
Assistant: New password accepted by indexer 🟢
Assistant: New password accepted by dashboard 🟢
Assistant: Old password rejected 🟢
Assistant: Wazuh manager api reachable 🟢
Ubuntu 22 ARM
Devops Integration Tests Results
Summary for PASSWORDS-TOOL
Status: PASS 🟢
Passed Tests
Assistant
Assistant: New password accepted by indexer 🟢
Assistant: New password accepted by dashboard 🟢
Assistant: Old password rejected 🟢
Assistant: Wazuh manager api reachable 🟢
Ubuntu 24 AMD
Devops Integration Tests Results
Summary for PASSWORDS-TOOL
Status: PASS 🟢
Passed Tests
Assistant
Assistant: New password accepted by indexer 🟢
Assistant: New password accepted by dashboard 🟢
Assistant: Old password rejected 🟢
Assistant: Wazuh manager api reachable 🟢
Ubuntu 24 ARM
# Devops Integration Tests ResultsSummary for PASSWORDS-TOOL
Status: PASS 🟢
Passed Tests
Assistant
Assistant: New password accepted by indexer 🟢
Assistant: New password accepted by dashboard 🟢
Assistant: Old password rejected 🟢
Assistant: Wazuh manager api reachable 🟢
Amazon Linux 2023 AMD
Failed due to error into password tool:
Amazon Linux 2023 ARM
Failed due to error into password tool: