Chandan Kumar (raukadah) d1edf92c8f Refactor: Extract common test utilities into shared base class
Consolidate duplicated test utilities from BaseInfraOptimTest and
BaseInfraOptimScenarioTest into a new BaseCommon class to improve
maintainability and eliminate code duplication.

Changes include:
* New common test base class (tests/common/base.py):
  - Shared resource management methods: create_audit_template,
    delete_audit_template, create_audit, cancel_audit, delete_audit,
    and delete_action_plan
  - State validation helpers: is_audit_idle, has_audit_succeeded,
    has_audit_finished, has_audit_failed
  - Type-safe constants using frozen Enum classes for IdleStates,
    AuditFinishedStates, and ActionPlanFinishedStates

* Enhanced resource lifecycle management:
  - Replace class-level resource tracking with addCleanup() for
    more reliable cleanup and better test isolation
  - Automatic cancellation of ONGOING/PENDING audits before deletion
  - Graceful handling of NotFound exceptions during cleanup

* Bug fixes:
  - Resolve IndexError in test_action_plan.py by converting from
    class-level resource_setup() to instance-level setUp()
  - Add wait_for_all_action_plans_to_finish() before audit creation
    to prevent race conditions

* Test isolation improvements:
  - Convert class methods to instance methods where appropriate
  - Skip redundant audit cancellation when audit has already succeeded

* Code cleanup:
  - Remove unused imports (time, functools, indirect data_utils)
  - Consolidate audit cancellation logic with new cancel_audit() helper

Assisted-By: Cursor (claude-4.5-sonnet)
Change-Id: Ife6392c564b239d5e30d4c53807b3ab8d6298adf
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
2025-11-25 10:40:28 +00:00
2017-08-04 16:46:20 +03:00
2019-04-19 19:40:39 +00:00
2017-08-04 16:46:20 +03:00
2017-08-04 16:46:20 +03:00
2019-06-05 09:55:20 +08:00
2017-08-04 16:46:20 +03:00
2025-04-16 11:41:25 +02:00
2020-04-05 14:56:26 +08:00
2025-05-09 10:37:13 +02:00

watcher-tempest-plugin

This repository contains a Tempest test plugin to verify the functionality of the Watcher service.

See the following docs to learn more:

Description
Tempest plugin for the watcher project.
Readme 4.2 MiB
Languages
Python 100%