Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the tests to mock access to the agent_info.db database. #586

Closed
4 tasks done
Nicogp opened this issue Feb 10, 2025 · 1 comment · Fixed by #570
Closed
4 tasks done

Refactor the tests to mock access to the agent_info.db database. #586

Nicogp opened this issue Feb 10, 2025 · 1 comment · Fixed by #570
Assignees
Labels
level/subtask Subtask issue module/agent type/change Change performed in a resource or Wazuh Cloud environment

Comments

@Nicogp
Copy link
Member

Nicogp commented Feb 10, 2025

Related issue
#518

Description

The introduction of the feature mentioned in #122 enables us to improve the reliability of our test suite by:

  • Mocking database interactions: existing tests that rely on real database connections can now be refactored to utilize mocked interactions.

This will allow us to write more efficient, reliable, and maintainable tests.

Tests to be modified to avoid interactions with the agent_info.db database:

  • AgentInfo
  • AgentInfoPersistence
  • AgentRegistration
  • Agent
@Nicogp Nicogp self-assigned this Feb 10, 2025
@Nicogp Nicogp added level/subtask Subtask issue type/change Change performed in a resource or Wazuh Cloud environment module/agent labels Feb 10, 2025
@Nicogp Nicogp changed the title Refactor the tests to simulate access to the agent_info.db database. Refactor the tests to mock access to the agent_info.db database. Feb 10, 2025
@Nicogp Nicogp linked a pull request Feb 10, 2025 that will close this issue
6 tasks
@wazuhci wazuhci moved this to In progress in XDR+SIEM/Release 5.0.0 Feb 10, 2025
@Nicogp
Copy link
Member Author

Nicogp commented Feb 11, 2025

Work update

2025/02/10

  • Solved the UTs crash in macos
  • I made the changes for Agent_test
  • I have been making the changes requested in the review

@wazuhci wazuhci moved this from In progress to In review in XDR+SIEM/Release 5.0.0 Feb 11, 2025
@wazuhci wazuhci moved this from In review to Done in XDR+SIEM/Release 5.0.0 Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/subtask Subtask issue module/agent type/change Change performed in a resource or Wazuh Cloud environment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant