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

Update API configuration integration tests #2370

Merged
merged 3 commits into from
Jan 7, 2022

Conversation

vicferpoy
Copy link
Contributor

Related issue
closes #2365

Description

After some changes in the API configuration parameters, some of the API configuration integration tests needed an update. Further information in the issue above.

Configuration options

We removed the following options from the affected tests configuration YAML files:

    logs:
      path: /test_logs/test.log

      key: "/test_cert/server.key"
      cert: "/test_cert/server.crt"
      use_ca: no
      ca: "/test_cert/ca.crt"

With these changes, these tests must work on v4.2 as well.

Tests

  • Proven that tests pass when they have to pass.
  • Proven that tests fail when they have to fail.
  • Python codebase satisfies PEP-8 style style guide. pycodestyle --max-line-length=120 --show-source --show-pep8 file.py.
  • Python codebase is documented following the Google Style for Python docstrings.
  • The test is documented in wazuh-qa/docs.
  • provision_documentation.sh generate the docs without errors.
root@wazuh-master:/wazuh-qa/tests/integration# python3 -m pytest test_api/test_config/test_logs/ -vv

================================================================================================================================== test session starts ===================================================================================================================================
platform linux -- Python 3.8.10, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.8.10', 'Platform': 'Linux-5.13.19-100.fc33.x86_64-x86_64-with-glibc2.29', 'Packages': {'pytest': '6.2.2', 'py': '1.10.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.11.0', 'html': '3.1.1', 'testinfra': '5.0.0'}}
rootdir: /wazuh-qa/tests/integration, configfile: pytest.ini
plugins: metadata-1.11.0, html-3.1.1, testinfra-5.0.0
collected 4 items                                                                                                                                                                                                                                                                        

test_api/test_config/test_logs/test_logs.py::test_logs[get_configuration0-tags_to_apply0] PASSED                                                                                                                                                                                   [ 25%]
test_api/test_config/test_logs/test_logs.py::test_logs[get_configuration0-tags_to_apply1] SKIPPED (Does not apply to this config file)                                                                                                                                             [ 50%]
test_api/test_config/test_logs/test_logs.py::test_logs[get_configuration1-tags_to_apply0] SKIPPED (Does not apply to this config file)                                                                                                                                             [ 75%]
test_api/test_config/test_logs/test_logs.py::test_logs[get_configuration1-tags_to_apply1] PASSED                                                                                                                                                                                   [100%]

============================================================================================================================= 2 passed, 2 skipped in 49.10s ==============================================================================================================================



root@wazuh-master:/wazuh-qa/tests/integration# python3 -m pytest test_api/test_config/test_https/ -vv

================================================================================================================================== test session starts ===================================================================================================================================
platform linux -- Python 3.8.10, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.8.10', 'Platform': 'Linux-5.13.19-100.fc33.x86_64-x86_64-with-glibc2.29', 'Packages': {'pytest': '6.2.2', 'py': '1.10.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.11.0', 'html': '3.1.1', 'testinfra': '5.0.0'}}
rootdir: /wazuh-qa/tests/integration, configfile: pytest.ini
plugins: metadata-1.11.0, html-3.1.1, testinfra-5.0.0
collected 4 items                                                                                                                                                                                                                                                                        

test_api/test_config/test_https/test_https.py::test_https[get_configuration0-tags_to_apply0] PASSED                                                                                                                                                                                [ 25%]
test_api/test_config/test_https/test_https.py::test_https[get_configuration0-tags_to_apply1] SKIPPED (Does not apply to this config file)                                                                                                                                          [ 50%]
test_api/test_config/test_https/test_https.py::test_https[get_configuration1-tags_to_apply0] SKIPPED (Does not apply to this config file)                                                                                                                                          [ 75%]
test_api/test_config/test_https/test_https.py::test_https[get_configuration1-tags_to_apply1] PASSED                                                                                                                                                                                [100%]

============================================================================================================================= 2 passed, 2 skipped in 36.29s ==============================================================================================================================

@vicferpoy vicferpoy self-assigned this Dec 21, 2021
@Kondent Kondent self-requested a review December 21, 2021 12:45
Kondent
Kondent previously approved these changes Dec 21, 2021
Copy link
Contributor

@Kondent Kondent left a comment

Choose a reason for hiding this comment

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

LGTM

davidjiglesias
davidjiglesias previously approved these changes Dec 21, 2021
@Rebits Rebits dismissed stale reviews from davidjiglesias and Kondent via 8c4fb7c December 22, 2021 16:56
@Rebits
Copy link
Member

Rebits commented Dec 23, 2021

23/12/21

Full-green obtained after including the log file truncation in the restart API fixture.

Package

Version Revision Link
4.3 1 https://packages-dev.wazuh.com/pre-release/yum/wazuh-manager-4.3.0-1.x86_64.rpm

Testing

API

Centos: 8 - Manager Local Jenkins Notes
PS1 🟢 🟢
PS2 🟢 🟢
PS3 🟢 🟢

  • 🟢: All pass
  • 🟡 Some warnings
  • 🔴: Some errors/fails
  • 🔵: In progress

Copy link
Member

@Rebits Rebits left a comment

Choose a reason for hiding this comment

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

LGTM

@snaow snaow merged commit 1f474b6 into master Jan 7, 2022
@snaow snaow deleted the 2365-api-configuration-tests branch January 7, 2022 07:25
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update API configuration integration tests
5 participants