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

Validate if the tests are documented as a precondition to use the automatic mode in qa-ctl #2023

Closed
Tracked by #2021 ...
jmv74211 opened this issue Oct 11, 2021 · 3 comments
Assignees

Comments

@jmv74211
Copy link
Contributor

jmv74211 commented Oct 11, 2021

To build the qa-ctl environment information and configuration file in automatic mode, qa-ctl makes use of the qa-docs tool which parses the test documentation and generates the corresponding files used by qa-ctl.

As a precondition for parsing the test information, it is necessary that the tests are documented according to a specific schema.

It is requested to add a new validation that allows alerting the user in case the test or set of tests that are being launched are not documented, so it will not be possible to launch qa-ctl automatically. This check should also be done by the qa-docs tool, so we will have to talk to the team that maintains it to add the corresponding validation, and then qa-ctl will interpret it.

Note: This issue will probably need to be worked on together with the qa-docs team to make this validation from qa-docs and then propagate it to qa-ctl.

@fernandolojano
Copy link
Contributor

fernandolojano commented Oct 19, 2021

The changes of this issue are already done, however, before committing them to the 2021-qa-ctl-v2 branch, we need the qa-docs v0.1 released due to the fact that the changes done in this issue won't work with the published version of qa-docs. As a consequence of the situation explained above, this issue will remain blocked by issue #2075 .

@fernandolojano
Copy link
Contributor

the working branch for this issue is: 2023-qa-ctl-documented-test-validation

@fernandolojano
Copy link
Contributor

As we have the new changes from qa-docs, it is only needed to add a single line in qa-ctl to make the validation, due to the fact that qa-docs is in charge of raising all the proper error exceptions for every case scenario. However, the output includes an additional message output coming from the execution of the qa-docs execution. It is needed to check if the last message can be removed.
Apart from that, several executions of the tool have been done in order to check that nothing unexpected happens, and so far, everything is working properly

not desired additional output message
qa-ctl -r test_shared_configuration --qa-branch 2023-qa-ctl-documented-test-validation
2021-10-20 14:03:14,522 - INFO - Validating input parameters
2021-10-20 14:03:15,789 - INFO - Looking for test_shared_configuration.py
2021-10-20 14:03:15,791 - INFO - Parsing the following test(s) ['test_shared_configuration']
2021-10-20 14:03:15,819 - INFO - Running QADOCS
2021-10-20 14:03:15,819 - INFO - Starting test documentation parsing
2021-10-20 14:03:15,819 - INFO - Looking for test_shared_configuration.py
2021-10-20 14:03:15,822 - ERROR - Documentation block not found in /tmp/wazuh_qa_ctl/wazuh-qa/tests/integration/test_remoted/test_agent_communication/test_shared_configuration.py
2021-10-20 14:03:15,822 - ERROR - Documentation block not found in /tmp/wazuh_qa_ctl/wazuh-qa/tests/integration/test_remoted/test_agent_communication/test_shared_configuration.py
wazuh_testing.tools.exceptions.QAValueError: Documentation block not found in /tmp/wazuh_qa_ctl/wazuh-qa/tests/integration/test_remoted/test_agent_communication/test_shared_configuration.py
2021-10-20 14:03:15,846 - ERROR - The command qa-docs -I /tmp/wazuh_qa_ctl/wazuh-qa/tests -t test_shared_configuration  returned 1 as result code.
wazuh_testing.tools.exceptions.QAValueError: The command qa-docs -I /tmp/wazuh_qa_ctl/wazuh-qa/tests -t test_shared_configuration  returned 1 as result code.

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

No branches or pull requests

2 participants