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 tests to mock database access #518

Open
8 tasks
jr0me opened this issue Jan 20, 2025 · 0 comments
Open
8 tasks

Refactor tests to mock database access #518

jr0me opened this issue Jan 20, 2025 · 0 comments
Assignees
Labels
level/task Task issue module/agent type/change Change performed in a resource or Wazuh Cloud environment

Comments

@jr0me
Copy link
Member

jr0me commented Jan 20, 2025

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 that should be modified:

  • AgentInfo
  • AgentInfoPersistence
  • CommandHandler
  • CommandStore
  • MultiTypeQueue
  • Storage
  • AgentRegistration
  • Agent

To be sure that there are no other tests writing to databases on disk a more thorough examination is encouraged, verify that SQL is not used when running the tests and that no new .db files are created.

@jr0me jr0me added level/task Task issue module/agent type/change Change performed in a resource or Wazuh Cloud environment labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue module/agent type/change Change performed in a resource or Wazuh Cloud environment
Projects
None yet
Development

No branches or pull requests

2 participants