Adds option to skip specific tests

With this we can specify a class name or a specific test
(class.method) to skip.

Change-Id: I2effb5c937fbe2b54a34049651b0d5d194550589
This commit is contained in:
Rabi Mishra 2015-08-12 18:39:38 +05:30
parent f1d76c07f6
commit 0a67b9886b
4 changed files with 22 additions and 14 deletions

View File

@ -101,11 +101,13 @@ IntegrationTestGroup = [
default=False, default=False,
help="Skip all functional tests"), help="Skip all functional tests"),
cfg.ListOpt('skip_functional_test_list', cfg.ListOpt('skip_functional_test_list',
help="List of functional test class names to skip " help="List of functional test class or class.method "
"ex. AutoscalingGroupTest, CreateStackTest"), "names to skip ex. AutoscalingGroupTest,"
"InstanceGroupBasicTest.test_size_updates_work"),
cfg.ListOpt('skip_scenario_test_list', cfg.ListOpt('skip_scenario_test_list',
help="List of scenario test class names to skip " help="List of scenario test class or class.method "
"ex. NeutronLoadBalancerTest,"), "names to skip ex. NeutronLoadBalancerTest, "
"CeilometerAlarmTest.test_alarm"),
cfg.ListOpt('skip_test_stack_action_list', cfg.ListOpt('skip_test_stack_action_list',
help="List of stack actions in tests to skip " help="List of stack actions in tests to skip "
"ex. ABANDON, ADOPT, SUSPEND, RESUME"), "ex. ABANDON, ADOPT, SUSPEND, RESUME"),

View File

@ -21,8 +21,11 @@ class FunctionalTestsBase(test.HeatIntegrationTest):
self.client = self.orchestration_client self.client = self.orchestration_client
def check_skip_test(self): def check_skip_test(self):
test_name = self.__class__.__name__ test_cls_name = self.__class__.__name__
test_skipped = (self.conf.skip_functional_test_list and test_method_name = '.'.join([test_cls_name, self._testMethodName])
test_name in self.conf.skip_functional_test_list) test_skipped = (self.conf.skip_functional_test_list and (
test_cls_name in self.conf.skip_functional_test_list or
test_method_name in self.conf.skip_functional_test_list))
if self.conf.skip_functional_tests or test_skipped: if self.conf.skip_functional_tests or test_skipped:
self.skipTest('Test disabled in conf, skipping') self.skipTest('Test disabled in conf, skipping')

View File

@ -84,12 +84,13 @@
# Skip all functional tests (boolean value) # Skip all functional tests (boolean value)
#skip_functional_tests = false #skip_functional_tests = false
# List of functional test class names to skip ex. AutoscalingGroupTest, # List of functional test class or class.method names to skip ex.
# CreateStackTest (list value) # AutoscalingGroupTest,InstanceGroupBasicTest.test_size_updates_work (list
# value)
#skip_functional_test_list = <None> #skip_functional_test_list = <None>
# List of scenario test class names to skip ex. NeutronLoadBalancerTest, (list # List of scenario test class or class.method names to skip ex.
# value) # NeutronLoadBalancerTest, CeilometerAlarmTest.test_alarm (list value)
#skip_scenario_test_list = <None> #skip_scenario_test_list = <None>
# List of stack actions in tests to skip ex. ABANDON, ADOPT, SUSPEND, RESUME # List of stack actions in tests to skip ex. ABANDON, ADOPT, SUSPEND, RESUME

View File

@ -59,8 +59,10 @@ class ScenarioTestsBase(test.HeatIntegrationTest):
return stack_id return stack_id
def check_skip_test(self): def check_skip_test(self):
test_name = self.__class__.__name__ test_cls_name = self.__class__.__name__
test_skipped = (self.conf.skip_scenario_test_list and test_method_name = '.'.join([test_cls_name, self._testMethodName])
test_name in self.conf.skip_scenario_test_list) test_skipped = (self.conf.skip_scenario_test_list and (
test_cls_name in self.conf.skip_scenario_test_list or
test_method_name in self.conf.skip_scenario_test_list))
if self.conf.skip_scenario_tests or test_skipped: if self.conf.skip_scenario_tests or test_skipped:
self.skipTest('Test disabled in conf, skipping') self.skipTest('Test disabled in conf, skipping')