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

Improve QACTL logging and show test results in the stdout #1795

Merged
merged 3 commits into from
Aug 30, 2021

Conversation

jmv74211
Copy link
Contributor

Related issue
close #1794

Description

The aim of this PR is to improve the QACTL logging and show the test results in the stdout console.

This PR makes the following changes:

  • Add new logging messages
  • Update logging messages
  • Add test results in the stdout output
  • Add new logging formatter for >= INFO levels to avoid module name logging
DEBUG Logging
2021-08-27 15:24:02,586 - DEBUG - qa_test_runner - Processing inventory data from testing hosts info
2021-08-27 15:24:02,587 - DEBUG - qa_test_runner - Inventory data from testing hosts info was processed successfully
2021-08-27 15:24:02,587 - DEBUG - qa_test_runner - Processing testing data from hosts
2021-08-27 15:24:02,588 - DEBUG - qa_test_runner - Testing data from hosts info was processed successfully
2021-08-27 15:24:02,588 - INFO - qa_test_runner - Launching 3 tests
2021-08-27 15:24:02,588 - DEBUG - test_launcher - Setting local_internal_options configuration in ['172.16.1.70'] hosts
2021-08-27 15:24:02,589 - DEBUG - test_launcher - Setting local_internal_options configuration in ['172.16.1.80'] hosts
2021-08-27 15:24:02,589 - DEBUG - test_launcher - Setting local_internal_options configuration in ['172.16.1.90'] hosts
2021-08-27 15:24:02,590 - INFO - qa_test_runner - Waiting for tests to finish
2021-08-27 15:24:03,569 - DEBUG - ansible_playbook - /tmp/1630070642.588256.yaml playbook file was deleted
2021-08-27 15:24:03,569 - INFO - pytest - Running /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py test on ['172.16.1.70'] hosts
2021-08-27 15:24:03,569 - DEBUG - pytest - Running python3 -m pytest /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py --tb=auto --html='/tmp/wazuh-qa/tests/integration/reports//test_report-2021-08-27 15:24:03.569463.html' on ['172.16.1.70'] hosts
2021-08-27 15:24:03,605 - DEBUG - ansible_playbook - /tmp/1630070642.589253.yaml playbook file was deleted
2021-08-27 15:24:03,605 - INFO - pytest - Running /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py test on ['172.16.1.90'] hosts
2021-08-27 15:24:03,605 - DEBUG - pytest - Running python3 -m pytest /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py --tb=auto --html='/tmp/wazuh-qa/tests/integration/reports//test_report-2021-08-27 15:24:03.605548.html' on ['172.16.1.90'] hosts
2021-08-27 15:24:03,619 - DEBUG - ansible_playbook - /tmp/1630070642.589091.yaml playbook file was deleted
2021-08-27 15:24:03,619 - INFO - pytest - Running /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py test on ['172.16.1.80'] hosts
2021-08-27 15:24:03,619 - DEBUG - pytest - Running python3 -m pytest /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py --tb=auto --html='/tmp/wazuh-qa/tests/integration/reports//test_report-2021-08-27 15:24:03.619727.html' on ['172.16.1.80'] hosts
2021-08-27 15:24:09,518 - DEBUG - ansible_playbook - /tmp/1630070643.569484.yaml playbook file was deleted
2021-08-27 15:24:09,519 - DEBUG - pytest - /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py tests of ['172.16.1.70'] hosts were saved in /home/jmv74211/Documents/test/4
2021-08-27 15:24:09,519 - INFO - pytest - 

============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /tmp/wazuh-qa/tests/integration, configfile: pytest.ini
plugins: html-2.0.1, testinfra-6.0.0, metadata-1.11.0, testinfra-6.4.0
collected 4 items

../../tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py . [ 25%]
ss.                                                                      [100%]

- generated html file: file:///tmp/wazuh-qa/tests/integration/reports/test_report-2021-08-27 15:24:03.569463.html -
========================= 2 passed, 2 skipped in 1.24s =========================


2021-08-27 15:24:09,841 - DEBUG - ansible_playbook - /tmp/1630070643.619746.yaml playbook file was deleted
2021-08-27 15:24:09,842 - DEBUG - pytest - /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py tests of ['172.16.1.80'] hosts were saved in /home/jmv74211/Documents/test/5
2021-08-27 15:24:09,842 - INFO - pytest - 

============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /tmp/wazuh-qa/tests/integration, configfile: pytest.ini
plugins: html-2.0.1, testinfra-6.0.0, metadata-1.11.0, testinfra-6.4.0
collected 4 items

../../tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py . [ 25%]
ss.                                                                      [100%]

- generated html file: file:///tmp/wazuh-qa/tests/integration/reports/test_report-2021-08-27 15:24:03.619727.html -
========================= 2 passed, 2 skipped in 1.59s =========================


2021-08-27 15:24:10,286 - DEBUG - ansible_playbook - /tmp/1630070643.605566.yaml playbook file was deleted
2021-08-27 15:24:10,287 - DEBUG - pytest - /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py tests of ['172.16.1.90'] hosts were saved in /home/jmv74211/Documents/test/6
2021-08-27 15:24:10,287 - INFO - pytest - 

============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /tmp/wazuh-qa/tests/integration, configfile: pytest.ini
plugins: html-2.0.1, testinfra-6.0.0, metadata-1.11.0, testinfra-6.4.0
collected 4 items

../../tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py . [ 25%]
ss.                                                                      [100%]

- generated html file: file:///tmp/wazuh-qa/tests/integration/reports/test_report-2021-08-27 15:24:03.605548.html -
========================= 2 passed, 2 skipped in 2.05s =========================


2021-08-27 15:24:10,287 - INFO - qa_test_runner - The test run is finished
INFO Logging
2021-08-27 15:36:16,865 - INFO - Launching 3 tests
2021-08-27 15:36:16,867 - INFO - Waiting for tests to finish
2021-08-27 15:36:18,370 - INFO - Running /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py test on ['172.16.1.80'] hosts
2021-08-27 15:36:18,375 - INFO - Running /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py test on ['172.16.1.70'] hosts
2021-08-27 15:36:18,387 - INFO - Running /tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py test on ['172.16.1.90'] hosts
2021-08-27 15:36:24,465 - INFO - 

============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /tmp/wazuh-qa/tests/integration, configfile: pytest.ini
plugins: html-2.0.1, testinfra-6.0.0, metadata-1.11.0, testinfra-6.4.0
collected 4 items

../../tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py . [ 25%]
ss.                                                                      [100%]

- generated html file: file:///tmp/wazuh-qa/tests/integration/reports/test_report-2021-08-27 15:36:18.387259.html -
========================= 2 passed, 2 skipped in 1.15s =========================


2021-08-27 15:36:24,585 - INFO - 

============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /tmp/wazuh-qa/tests/integration, configfile: pytest.ini
plugins: html-2.0.1, testinfra-6.0.0, metadata-1.11.0, testinfra-6.4.0
collected 4 items

../../tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py . [ 25%]
ss.                                                                      [100%]

- generated html file: file:///tmp/wazuh-qa/tests/integration/reports/test_report-2021-08-27 15:36:18.375093.html -
========================= 2 passed, 2 skipped in 1.35s =========================


2021-08-27 15:36:24,938 - INFO - 

============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /tmp/wazuh-qa/tests/integration, configfile: pytest.ini
plugins: html-2.0.1, testinfra-6.0.0, metadata-1.11.0, testinfra-6.4.0
collected 4 items

../../tmp/wazuh-qa/tests/integration/test_vulnerability_detector/test_general_settings/test_general_settings_enabled.py . [ 25%]
ss.                                                                      [100%]

- generated html file: file:///tmp/wazuh-qa/tests/integration/reports/test_report-2021-08-27 15:36:18.370331.html -
========================= 2 passed, 2 skipped in 1.72s =========================


2021-08-27 15:36:24,938 - INFO - The test run is finished

@jmv74211 jmv74211 self-assigned this Aug 27, 2021
@jmv74211 jmv74211 merged commit e4d60e7 into 1533-qa-ctl Aug 30, 2021
@jmv74211 jmv74211 deleted the 1794-development branch August 30, 2021 07:52
@jmv74211 jmv74211 mentioned this pull request Oct 11, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants