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

Integrate qa-docs into wazuh-qa framework #1854

Merged
merged 19 commits into from
Sep 9, 2021
Merged

Conversation

roronoasins
Copy link
Contributor

@roronoasins roronoasins commented Sep 8, 2021

Related issue
#1800

Description

QADOCS use is required not only for users but the QA framework. We decided to include this tool within the QA framework so there are no path dependencies.

It has been moved from docs/DocGenerator to deps/wazuh_testing/qa_docs and is installed running the deps/wazuh_testing/setup.py(npm modules installation needed, now working if you manually install them. It has to be changed).

Use: qa-docs [-h] [-s] [-v] [-t] [-d] [-i INDEX_NAME] [-l LAUNCH_APP] [-T TEST_INPUT] [-o OUTPUT_PATH] -I TEST_DIR

optional arguments:
  -h, --help      show this help message and exit
  -s              Run a sanity check
  -v              Print version
  -t              Test configuration
  -d              Enable debug messages.
  -i INDEX_NAME   Indexes the data to elasticsearch.
  -l LAUNCH_APP   Indexes the data and launch the application.
  -T TEST_INPUT   Test name or path to parse.
  -o OUTPUT_PATH  Output directory path.
  -I TEST_DIR     Tests input directory

The new use is specified here. The wiki will be updated once this branch is merged.

The entire changes in QADOCS are located in #1800.

Few examples:
In order to run qa-docs, you need to specify the tests directory that you want to parse.

  • Parsing all included directories within tests directory
(docgen) luisgr@luisgr-pc:~/work/wazuh-qa/deps/wazuh_testing$ qa-docs -I ../../tests/
  • Parsing single test
(docgen) luisgr@luisgr-pc:~/work/wazuh-qa/deps/wazuh_testing$ qa-docs -I ../../tests/ -T test_general_settings_enabled
test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py: 4

test_system: ['linux']
test_vendor: ['redhat', 'debian', 'ubuntu', 'alas', 'arch-linux', 'centos']
test_version: ['centos6', 'centos7', 'centos8', 'rhel6', 'rhel7', 'rhel8', 'buster', 'stretch', 'wheezy', 'bionic', 'xenial', 'trusty', 'amazon-linux-1', 'amazon-linux-2']
test_target: ['manager']
test_wazuh_min_version: 3.13
(docgen) luisgr@luisgr-pc:~/work/wazuh-qa/deps/wazuh_testing$ qa-docs -I ../../tests/ -T test_general_settings_enabled -o /tmp

Luis Gonzalez and others added 18 commits September 2, 2021 14:22
Logic added, now it has to be implemented.
It will help to classify DocGenerator behaviour, even if we keep adding new functionalities
The test doc is printed to standard output, now requires to use the keys that QACTL needs. Also add the output file functionality.
Using the config.yaml, now the fields printed are specified in `Module info` and `Test info`, so you can get the info you want.
#1800

This file contains the module and test info that you specify in config.yaml
The following tests have been documented:
  * test_execd_firewall_drop.py
  * test_execd_restart.py
  * test_cache.py
  * test_cache.py
The tests have been documented following the schema proposed by the qactl team.
Update DocGenerator/config.yaml
PEP-8 fixes

Closes: #1840
All working except `-l` option, `search_ui` folder is not installed properly. Folders missing inside.
@roronoasins roronoasins added team/qa refactor Redesign and implement an existing development/feature labels Sep 8, 2021
@roronoasins roronoasins self-assigned this Sep 8, 2021
Copy link
Contributor

@jmv74211 jmv74211 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, but a lot of changes are required. We will see all this in a live review.

deps/wazuh_testing/wazuh_testing/qa_docs/doc_generator.py Outdated Show resolved Hide resolved
deps/wazuh_testing/wazuh_testing/qa_docs/doc_generator.py Outdated Show resolved Hide resolved
deps/wazuh_testing/wazuh_testing/qa_docs/doc_generator.py Outdated Show resolved Hide resolved
deps/wazuh_testing/wazuh_testing/qa_docs/doc_generator.py Outdated Show resolved Hide resolved
deps/wazuh_testing/wazuh_testing/qa_docs/doc_generator.py Outdated Show resolved Hide resolved
deps/wazuh_testing/wazuh_testing/qa_docs/lib/index_data.py Outdated Show resolved Hide resolved
deps/wazuh_testing/wazuh_testing/scripts/qa_docs.py Outdated Show resolved Hide resolved
deps/wazuh_testing/wazuh_testing/scripts/qa_docs.py Outdated Show resolved Hide resolved
@jmv74211 jmv74211 merged commit a003b4d into master Sep 9, 2021
@jmv74211 jmv74211 deleted the 1800-parse-single-test branch September 9, 2021 08:56
@roronoasins roronoasins linked an issue Oct 7, 2021 that may be closed by this pull request
12 tasks
@roronoasins roronoasins changed the title Integrate QADOCS into wazuh-qa framework Integrate qa-docs into wazuh-qa framework Oct 7, 2021
@snaow snaow mentioned this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Redesign and implement an existing development/feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate test output file using DocGenerator
4 participants