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>
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:
- Free software: Apache license
- Documentation: https://docs.openstack.org/watcher-tempest-plugin/latest/
- Release notes: https://docs.openstack.org/releasenotes/watcher-tempest-plugin/
- Source: https://opendev.org/openstack/watcher-tempest-plugin
- Bugs: https://bugs.launchpad.net/watcher-tempest-plugin
Description
Languages
Python
100%