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,
help="Skip all functional tests"),
cfg.ListOpt('skip_functional_test_list',
help="List of functional test class names to skip "
"ex. AutoscalingGroupTest, CreateStackTest"),
help="List of functional test class or class.method "
"names to skip ex. AutoscalingGroupTest,"
"InstanceGroupBasicTest.test_size_updates_work"),
cfg.ListOpt('skip_scenario_test_list',
help="List of scenario test class names to skip "
"ex. NeutronLoadBalancerTest,"),
help="List of scenario test class or class.method "
"names to skip ex. NeutronLoadBalancerTest, "
"CeilometerAlarmTest.test_alarm"),
cfg.ListOpt('skip_test_stack_action_list',
help="List of stack actions in tests to skip "
"ex. ABANDON, ADOPT, SUSPEND, RESUME"),

View File

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

View File

@ -84,12 +84,13 @@
# Skip all functional tests (boolean value)
#skip_functional_tests = false
# List of functional test class names to skip ex. AutoscalingGroupTest,
# CreateStackTest (list value)
# List of functional test class or class.method names to skip ex.
# AutoscalingGroupTest,InstanceGroupBasicTest.test_size_updates_work (list
# value)
#skip_functional_test_list = <None>
# List of scenario test class names to skip ex. NeutronLoadBalancerTest, (list
# value)
# List of scenario test class or class.method names to skip ex.
# NeutronLoadBalancerTest, CeilometerAlarmTest.test_alarm (list value)
#skip_scenario_test_list = <None>
# 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
def check_skip_test(self):
test_name = self.__class__.__name__
test_skipped = (self.conf.skip_scenario_test_list and
test_name in self.conf.skip_scenario_test_list)
test_cls_name = self.__class__.__name__
test_method_name = '.'.join([test_cls_name, self._testMethodName])
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:
self.skipTest('Test disabled in conf, skipping')