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

Engine - Enhancing YAML Configurations for Detailed Unit Testing of Wazuh-Engine Helper Functions #23509

Closed
4 of 5 tasks
JcabreraC opened this issue May 17, 2024 · 6 comments · Fixed by #23697
Closed
4 of 5 tasks

Comments

@JcabreraC
Copy link
Member

JcabreraC commented May 17, 2024

Wazuh version Component Install type Install method Platform
5.0.0 Engine Manager Packages/Sources OS version

Description

Building on the foundation established in previous stages, Stage 3 of our testing framework development focuses on enhancing the YAML configurations to support detailed unit testing for Wazuh-Engine helper functions. This stage aims to enable precise specification of inputs and expected outputs within the YAML files, facilitating comprehensive end-to-end testing that aligns with the functional requirements of each helper function.

Objective

  • Enhanced Unit Testing Capabilities: Extend the YAML schema to include detailed specifications for inputs and expected outputs, enabling accurate and thorough unit testing of helper functions.

Requirements

  • Detailed Test Specifications: The YAML configuration should allow for the definition of complex test cases, including edge cases, error conditions, and varied input scenarios.
  • Precision and Clarity: Ensure that the extended YAML configurations provide clear and precise definitions for test scenarios, making them easy to understand and implement.
  • Compatibility and Integration: Maintain compatibility with the existing test generation and execution tools, ensuring that the new specifications can be seamlessly integrated without disrupting existing functionalities.

Tasks

  • Define and document enhancements to the YAML schema to include specific fields for test inputs, expected outputs, and additional testing parameters.
  • Update the test generation tool developed in Stage 1B to parse and utilize the enhanced YAML configurations for creating more detailed test cases.
  • Develop example YAML configurations that demonstrate the new capabilities and provide templates for developers to use for their specific testing needs.
  • Validate the updated toolchain with a series of tests to ensure that it correctly interprets and executes the specified test cases according to the enhanced YAML configurations.
  • Provide comprehensive documentation on how to write and structure the enhanced YAML files, including guidelines on specifying inputs and expected outputs.

Testing Criteria

  • Schema Accuracy and Flexibility: Test the updated YAML schema to ensure it can accurately represent complex testing scenarios and is flexible enough to cover a wide range of test cases.
  • Tool Compatibility: Verify that the existing tools can handle the enhanced YAML configurations without issues, producing correct and reliable test cases.
  • Documentation and Usability: Ensure that the documentation is clear and useful, enabling developers to easily adopt the enhanced configurations for their testing needs.
  • End-to-End Functionality: Conduct end-to-end tests to verify that the entire process from YAML configuration through to test execution functions smoothly and accurately.

Notes

This stage is critical for deepening the testing capabilities of our framework, providing the means to conduct detailed unit tests that closely mimic real-world usage scenarios. By enhancing the YAML configurations, we aim to empower developers to perform more precise and meaningful tests, thereby increasing the reliability and robustness of the Wazuh-Engine helper functions.

@NahuFigueroa97
Copy link
Member

NahuFigueroa97 commented May 20, 2024

Update:

  • Create parser for unit test for map and filter builders
  • Debug Parser combinator for bug in helpers with an argument of type array

@NahuFigueroa97
Copy link
Member

Update:

  • Study parser combinator
  • Add test to understand the bug

@NahuFigueroa97
Copy link
Member

Update:

  • Fix parser combinator bug
  • Correction UT

@NahuFigueroa97
Copy link
Member

Update:

  • I improved the previous solution, now literals are parsed by the Raw parser
  • Correction UT
  • Create parser for unit test for transform builder / array_append helper

@NahuFigueroa97
Copy link
Member

Update:

  • investigate why a test fails with the new fix
  • rephrase the parser combinator so that it doesn't take ')' as a separator
  • reformulate the combinator passer so that it takes spaces ' ' and fails if they do not have ',' or ')'

@NahuFigueroa97
Copy link
Member

Update:

  • Create parser for unit test for transform builder / replace helper
  • Check int_calculate helper for failure unit test in helper tool
  • check array_append helper for failure unit test in helper tool
  • PR in review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants