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

Refactor integratord test_integratord_read_json_file_deleted #3540

Merged
merged 16 commits into from
Jun 1, 2023

Conversation

fedepacher
Copy link
Contributor

@fedepacher fedepacher commented Oct 31, 2022

Related issue
#3298

Description

This PR aims to add some changes to the development made by @mauromalara in this PR.

Added

  • tests/integration/test_integratord/test_alerts_reading.py: All modules were unified in this one and several changes were applied in the tests functions and documentation.

Updated

  • deps/wazuh_testing/modules/analysisd/__init__.py: Callback added to detect its initialization.
  • deps/wazuh_testing/modules/integratord/__init__.py: Callbacks modified to fix the tests.
  • deps/wazuh_testing/modules/integratord/event_monitor.py: Callback functions modified and documentation improved.
  • deps/wazuh_testing/wazuh_testing/tools/__init__.py: Integratord socket added.
  • tests/integration/conftest.py: Fixture improved and Slack webhook parameter added. Daemons handler modified and wrapper with 'function' scope added.
  • tests/integration/test_integratord/conftest.py: Minor improvements.
  • tests/integration/test_integratord/data/configuration/configuration_alerts_reading.yaml: Configuration template modified to change the integration from VTotal to Slack.
  • tests/integration/test_integratord/data/test_cases/cases_integratord_change_inode_alert.yaml: Virustotal integration replaced.
  • tests/integration/test_integratord/data/test_cases/cases_integratord_read_invalid_json_alerts.yaml: Virustotal integration replaced.
  • tests/integration/test_integratord/data/test_cases/cases_integratord_read_valid_json_alerts.yaml: Virustotal integration replaced.

Deleted

  • tests/integration/test_integratord/data/test_cases/cases_integratord_read_json_file_deleted.yaml: Test case deleted because it was duplicated by test_change_inode_alert
  • tests/integration/test_integratord/test_integratord_read_json_file_deleted.py: Test deleted because it was duplicated by test_change_inode_alert
  • tests/integration/test_integratord/test_integratord_change_inode_alert.py: All modules were unified in test_alerts_reading.py
  • tests/integration/test_integratord/test_integratord_read_json_alerts.py: All modules were unified in test_alerts_reading.py
  • tests/integration/test_integratord/test_integratord_read_json_alerts.py: All modules were unified in test_alerts_reading.py

Testing performed

Tester Test path Jenkins Local OS Commit Notes
@mauromalara (Developer) test_integratord/ 🟢 🟢 🟢 🟢 🟢 🟢 🟢 🟢 Ubuntu 7b78001 -
@Rebits (Reviewer) ⚫⚫⚫ 🚫 🚫 🚫 Nothing to highlight

@@ -293,12 +321,12 @@ def pytest_addoption(parser):
help="run tests using a specific WPK package path"
)
parser.addoption(
"--integration-api-key",
"--slack-webhook-url",
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this change imply new modifications in jenkins ITs repository?

Copy link
Contributor

Choose a reason for hiding this comment

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

daemons.reverse()
for daemon in daemons:
logger.debug(f"Stopping {daemon}")
control_service('stop', daemon=daemon)
Copy link
Contributor

Choose a reason for hiding this comment

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

You are modifying a global fixture, so you have to guarantee that this change does not break anything.

Copy link
Contributor

Choose a reason for hiding this comment

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

IT Executions: #3540 (comment)

deps/wazuh_testing/wazuh_testing/tools/monitoring.py Outdated Show resolved Hide resolved
tests/integration/test_integratord/conftest.py Outdated Show resolved Hide resolved
@mauromalara
Copy link
Contributor

mauromalara commented Feb 3, 2023

Before merging these changes, it is necessary to merge this PR in the "wazuh-jenkins" repository.

More info: https://github.com/wazuh/wazuh-jenkins/issues/3838#issuecomment-1263990324

Also, it is necessary to merge the backport to 4.5 and create a backport of this PR to master. Also, it is necessary to apply these changes to 4.3

@mauromalara mauromalara self-assigned this Feb 7, 2023
@mauromalara mauromalara force-pushed the 3298-refactor-integratord-test-4-4 branch 2 times, most recently from e5daf81 to b50ca53 Compare February 7, 2023 16:21
@mauromalara
Copy link
Contributor

mauromalara commented Feb 7, 2023

Wazuh Jenkins dependency

This PR depends on some changes to be merged in the wazuh-jenkins repo:

  • wazuh/wazuh-jenkins#4690
  • wazuh/wazuh-jenkins#5230

@mauromalara
Copy link
Contributor

mauromalara commented Feb 8, 2023

Affected tests execution

Tests affected by some changes in this PR:

  • tests/integration/test_active_response/test_analysisd/test_overwritten_rules_ar.py
  • tests/integration/test_analysisd/test_signature_id/test_signature_id.py
R1 R2 R3
Local 🟢 🟢 🟢

@mauromalara
Copy link
Contributor

mauromalara commented Feb 9, 2023

Blocked by ⚠️

wazuh/wazuh-jenkins#4690

@mauromalara mauromalara force-pushed the 3298-refactor-integratord-test-4-4 branch from 7b78001 to 13d40bc Compare February 22, 2023 16:33
Copy link
Member

@juliamagan juliamagan left a comment

Choose a reason for hiding this comment

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

Please update branches and launch the tests to check that everything works as expected.

@mauromalara mauromalara force-pushed the 3298-refactor-integratord-test-4-4 branch from 13d40bc to 5b4a56c Compare May 10, 2023 17:43
@mauromalara mauromalara force-pushed the 3298-refactor-integratord-test-4-4 branch 3 times, most recently from ee35dd5 to 13d40bc Compare May 10, 2023 19:57
@mauromalara
Copy link
Contributor

mauromalara commented May 11, 2023

Last results

R1 R2 R3
🟢 🟢 🟢

Notes ⚠️

On Hold

This PR is waiting for #4126 because it depends on that fix to get merged.

Blocked by

Read this note.

@mauromalara
Copy link
Contributor

mauromalara commented May 12, 2023

After merging

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

@Rebits Rebits dismissed juliamagan’s stale review May 30, 2023 16:35

Branch updated and testing performed

@Rebits Rebits merged commit 3cb5df4 into 4.4 Jun 1, 2023
@Rebits Rebits deleted the 3298-refactor-integratord-test-4-4 branch June 1, 2023 13:10
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.

The integration test test_integratord_read_json_file_deleted is failing
5 participants