From 0b81f2b911cc274acd5ba39b66e0a718b65180e5 Mon Sep 17 00:00:00 2001 From: jgilaber Date: Tue, 2 Dec 2025 14:42:53 +0100 Subject: [PATCH] Add config flags to control zone migration test execution Add configuration checks to conditionally skip zone migration tests that require specific setup or code. This allows better control over which tests run in different CI environments. Changes: - Add run_zone_migration_extra_tests flag check to skip zone migration for instances without dst_node tests when disabled - Add run_zone_migration_storage_tests flag check to skip storage-related zone migration tests when disabled Generated-By: claude-code Change-Id: I362a8c3e9edefe21e46e3836d5b86f151c5fb446 Signed-off-by: jgilaber --- watcher_tempest_plugin/config.py | 11 +++++++++++ .../tests/scenario/test_execute_zone_migration.py | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/watcher_tempest_plugin/config.py b/watcher_tempest_plugin/config.py index ae7ed0a..3e3ed7e 100644 --- a/watcher_tempest_plugin/config.py +++ b/watcher_tempest_plugin/config.py @@ -144,4 +144,15 @@ OptimizationGroup = [ "`watcher_cluster_data_model_collectors` period configuration is " "less than 300 seconds." ), + cfg.BoolOpt( + "run_zone_migration_extra_tests", + default=False, + help="Whether or not to run extra zone migration tests that test" + "migration without specified destination nodes." + ), + cfg.BoolOpt( + "run_zone_migration_storage_tests", + default=False, + help="Whether or not to run storage zone migration tests." + ), ] diff --git a/watcher_tempest_plugin/tests/scenario/test_execute_zone_migration.py b/watcher_tempest_plugin/tests/scenario/test_execute_zone_migration.py index 92b61db..7c74d24 100644 --- a/watcher_tempest_plugin/tests/scenario/test_execute_zone_migration.py +++ b/watcher_tempest_plugin/tests/scenario/test_execute_zone_migration.py @@ -81,6 +81,10 @@ class TestExecuteZoneMigrationStrategy(TestZoneMigrationStrategyBase): @decorators.idempotent_id('e4f192ca-26d4-4e38-bb86-4be4aeaabb24') @decorators.attr(type=['strategy', 'zone_migration']) def test_execute_zone_migration_without_destination_host(self): + if not CONF.optimize.run_zone_migration_extra_tests: + raise self.skipException( + "Extra tests for zone migration are not enabled." + ) # This test requires metrics injection self.check_min_enabled_compute_nodes(2) self.addCleanup(self.wait_delete_instances_from_model) @@ -116,6 +120,10 @@ class TestExecuteZoneMigrationStrategyVolume(TestZoneMigrationStrategyBase): super().skip_checks() if not CONF.service_available.cinder: raise cls.skipException("Cinder is not available") + if not CONF.optimize.run_zone_migration_storage_tests: + raise cls.skipException( + "Storage tests for zone migration are not enabled." + ) def get_host_for_volume(self, volume_id): """Gets host of volume"""