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

qa-docs: Migrate logger and improve logging #1879

Closed
11 tasks done
Tracked by #1864
roronoasins opened this issue Sep 13, 2021 · 1 comment · Fixed by #1896
Closed
11 tasks done
Tracked by #1864

qa-docs: Migrate logger and improve logging #1879

roronoasins opened this issue Sep 13, 2021 · 1 comment · Fixed by #1896
Assignees
Labels
refactor Redesign and implement an existing development/feature tool/qa-docs

Comments

@roronoasins
Copy link

roronoasins commented Sep 13, 2021

Description:

A task from #1864. We want to fix and improve the logging in QADOCS. Now we have more than one module for logging warnings, for example.

In #1876 qadocs_logger has been included. Now we need to use it properly. Now only this logger will be used to register the logging.

Branch

1879-qadocs-logging

Tasks:

  • Migrate from old logger to qadocs_logger
    • qa-docs script
    • doc_generator module
    • code_parser module
    • config module
    • index_data module
    • pytest_wrap module
    • sanity module
    • utils module
  • Remove log messages generated by the warnings module
  • Fix logging: both standard and log file working
@roronoasins roronoasins changed the title Fix warnings logging and improve logging Migrate to QADOCS logger and improve logging Sep 13, 2021
@roronoasins roronoasins self-assigned this Sep 13, 2021
@roronoasins roronoasins added subteam/qa-docs tool/qa-docs refactor Redesign and implement an existing development/feature labels Sep 13, 2021
roronoasins pushed a commit that referenced this issue Sep 14, 2021
Now it has to be used in all `qa-docs` modules.
@roronoasins roronoasins changed the title Migrate to QADOCS logger and improve logging Migrate to qa-docs logger and improve logging Sep 15, 2021
roronoasins pushed a commit that referenced this issue Sep 15, 2021
roronoasins pushed a commit that referenced this issue Sep 15, 2021
roronoasins pushed a commit that referenced this issue Sep 15, 2021
…er in `Sanity` module. #1879

Also, sanity new lines style and `qa-docs` paths within wazuh framework fixed.
roronoasins pushed a commit that referenced this issue Sep 15, 2021
roronoasins pushed a commit that referenced this issue Sep 15, 2021
It only loads the config file within a Config instance.
@roronoasins
Copy link
Author

roronoasins commented Sep 15, 2021

Sample output when debug mode is enabled and only config file is loaded.

(docgen) luisgr@luisgr-pc:~/work/wazuh-qa/deps/wazuh_testing$ qa-docs -d -I /home/luisgr/work/wazuh-qa/tests/ -t
2021-09-15 12:30:10,190 - DEBUG - Validating input parameters
2021-09-15 12:30:10,191 - DEBUG - Input parameters validation successfully finished
2021-09-15 12:30:10,191 - DEBUG - Loading qa-docs configuration
2021-09-15 12:30:10,191 - DEBUG - Loading config file
2021-09-15 12:30:10,194 - DEBUG - Reading the regular expressions to include test methods from config file
2021-09-15 12:30:10,194 - DEBUG - Reading mandatory and optional module fields from config file
2021-09-15 12:30:10,194 - DEBUG - Reading mandatory and optional test fields from config file
2021-09-15 12:30:10,194 - DEBUG - Reading Test Case key from config file
2021-09-15 12:30:10,194 - DEBUG - Reading include paths from config file
2021-09-15 12:30:10,194 - DEBUG - Reading the regular expressions to include files from config file
2021-09-15 12:30:10,194 - DEBUG - Reading group files from config file
2021-09-15 12:30:10,194 - DEBUG - Reading the paths to be ignored from config file
2021-09-15 12:30:10,194 - DEBUG - Setting the path documentation
2021-09-15 12:30:10,194 - DEBUG - qa-docs configuration loaded

Another sample without debug level and parsing a single test:

(docgen) luisgr@luisgr-pc:~/work/wazuh-qa/deps/wazuh_testing$ qa-docs -I /home/luisgr/work/wazuh-qa/tests/ -T test_cache
2021-09-15 12:34:20,925 - INFO - Looking for test_cache.py
2021-09-15 12:34:20,929 - INFO - Parsing the following test(s) test_cache
2021-09-15 12:34:20,932 - INFO - Running QADOCS
2021-09-15 12:34:20,932 - INFO - Starting test documentation parsing
2021-09-15 12:34:20,932 - INFO - Looking for test_cache.py
test_api/test_config/test_cache/test_cache.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

@mdengra mdengra linked a pull request Sep 15, 2021 that will close this issue
@mdengra mdengra changed the title Migrate to qa-docs logger and improve logging qa-docs: Migrate logger and improve logging Sep 15, 2021
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 tool/qa-docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant