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

API specification empty value for key #16918

Closed
4 tasks done
GGP1 opened this issue Apr 28, 2023 · 3 comments · Fixed by #16987
Closed
4 tasks done

API specification empty value for key #16918

GGP1 opened this issue Apr 28, 2023 · 3 comments · Fixed by #16987
Assignees
Labels
module/api type/bug Something isn't working

Comments

@GGP1
Copy link
Member

GGP1 commented Apr 28, 2023

Wazuh version Component
4.6.0 Manager

Description

The API specification has a key with an empty value that is causing some Framework unit tests to fail. The conflicting key is at /wazuh/api/api/spec/spec.yaml:11624 and can be fixed by adding a None value to it.

Tavern 1.2.2 and pykwalify 1.7.0 must be installed to reproduce the error.

Test results

(venv2) gasti@pop-os:~/wazuh$ python3 -m pytest ~/wazuh/framework/wazuh/tests/test_security.py
==================================================================== test session starts ====================================================================
platform linux -- Python 3.9.16, pytest-5.4.3, py-1.11.0, pluggy-0.13.1
rootdir: /home/gasti/work/wazuh/framework
plugins: aiohttp-0.3.0, tavern-1.2.2, trio-0.7.0, html-2.1.1, asyncio-0.15.1, metadata-2.0.4
collected 71 items                                                                                                                                                                                                                                                                                                                                                                        

framework/wazuh/tests/test_security.py ............................................................FFFFFFF....                                     [100%]

FAILED framework/wazuh/tests/test_security.py::test_rbac_catalog[get_rbac_actions-params0-expected_result0] - tavern.util.exceptions.BadSchemaError: Error at /wazuh/api/api/spec/spec.yaml:11623 - column 28 - cannot define an empty value in test - either give it a value or explicitly set it to None
FAILED framework/wazuh/tests/test_security.py::test_rbac_catalog[get_rbac_actions-params1-expected_result1] - tavern.util.exceptions.BadSchemaError: Error at /wazuh/api/api/spec/spec.yaml:11623 - column 28 - cannot define an empty value in test - either give it a value or explicitly set it to None
FAILED framework/wazuh/tests/test_security.py::test_rbac_catalog[get_rbac_actions-params2-expected_result2] - tavern.util.exceptions.BadSchemaError: Error at /wazuh/api/api/spec/spec.yaml:11623 - column 28 - cannot define an empty value in test - either give it a value or explicitly set it to None
FAILED framework/wazuh/tests/test_security.py::test_rbac_catalog[get_rbac_actions-params3-expected_result3] - tavern.util.exceptions.BadSchemaError: Error at /wazuh/api/api/spec/spec.yaml:11623 - column 28 - cannot define an empty value in test - either give it a value or explicitly set it to None
FAILED framework/wazuh/tests/test_security.py::test_rbac_catalog[get_rbac_resources-params4-expected_result4] - tavern.util.exceptions.BadSchemaError: Error at /wazuh/api/api/spec/spec.yaml:11623 - column 28 - cannot define an empty value in test - either give it a value or explicitly set it to None
FAILED framework/wazuh/tests/test_security.py::test_rbac_catalog[get_rbac_resources-params5-expected_result5] - tavern.util.exceptions.BadSchemaError: Error at /wazuh/api/api/spec/spec.yaml:11623 - column 28 - cannot define an empty value in test - either give it a value or explicitly set it to None
FAILED framework/wazuh/tests/test_security.py::test_rbac_catalog[get_rbac_resources-params6-expected_result6] - tavern.util.exceptions.BadSchemaError: Error at /wazuh/api/api/spec/spec.yaml:11623 - column 28 - cannot define an empty value in test - either give it a value or explicitly set it to None

Checks

The following elements have been updated or reviewed (should also be checked if no modification is required):

  • Tests (unit tests, API integration tests).
  • Changelog.
  • Documentation.
  • Integration test mapping (using api/test/integration/mapping/_test_mapping.py).
@GGP1
Copy link
Member Author

GGP1 commented May 2, 2023

Update

Developed the fix, tested it locally and created a pull request with the changes. Moved to pending review.

@GGP1
Copy link
Member Author

GGP1 commented May 3, 2023

Update

Moved to blocked due to failed Linux build and Windows agent checks.

@GGP1
Copy link
Member Author

GGP1 commented May 24, 2023

Update

Rebased branch to master to re-run the checks.. Moved to pending review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/api type/bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant