From 16c327382babce82d4de2498040010c0f3c279fd Mon Sep 17 00:00:00 2001 From: Dmitry Tyzhnenko Date: Thu, 17 Dec 2015 16:22:32 +0200 Subject: [PATCH] Fix time consuming in the description uploader Remove creation of extra groups. Only one is valid - test_group(config) Reuse internal proboscis tool for discover cases. Change-Id: Ieb9434750c678e9adfd580026530b3fe3225c4b0 Closes-bug: #1527290 Closes-bug: #1527199 --- fuelweb_test/run_tests.py | 20 +++++++++---------- .../testrail/upload_cases_description.py | 11 ++++++++-- system_test/tests/base_actions_factory.py | 5 +---- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/fuelweb_test/run_tests.py b/fuelweb_test/run_tests.py index 9b4e24cdf..04c858745 100644 --- a/fuelweb_test/run_tests.py +++ b/fuelweb_test/run_tests.py @@ -26,22 +26,22 @@ def define_custom_groups(): groups_list = [ {"groups": ["system_test.ceph_ha"], "depends": [ - "system_test.deploy_and_check_radosgw." - "ceph_all_on_neutron_vlan"]}, + "system_test.deploy_and_check_radosgw(" + "ceph_all_on_neutron_vlan)"]}, {"groups": ["filling_root"], "depends": [ - "system_test.failover.filling_root." - "ceph_all_on_neutron_vlan"]}, + "system_test.failover.filling_root(" + "ceph_all_on_neutron_vlan)"]}, {"groups": ["system_test.strength"], "depends": [ - "system_test.failover.destroy_controllers." - "first.ceph_all_on_neutron_vlan", - "system_test.failover.destroy_controllers." - "second.1ctrl_ceph_2ctrl_1comp_1comp_ceph_neutronVLAN"]}, + "system_test.failover.destroy_controllers.first(" + "ceph_all_on_neutron_vlan)", + "system_test.failover.destroy_controllers.second(" + "1ctrl_ceph_2ctrl_1comp_1comp_ceph_neutronVLAN)"]}, {"groups": ["fuel_master_migrate"], "depends": [ - "system_test.fuel_migration.1ctrl_1comp_neutronVLAN", - "system_test.fuel_migration.1ctrl_1comp_neutronTUN"]} + "system_test.fuel_migration(1ctrl_1comp_neutronVLAN)", + "system_test.fuel_migration(1ctrl_1comp_neutronTUN)"]} ] for new_group in groups_list: diff --git a/fuelweb_test/testrail/upload_cases_description.py b/fuelweb_test/testrail/upload_cases_description.py index 6c1cac076..46f9b4f7f 100644 --- a/fuelweb_test/testrail/upload_cases_description.py +++ b/fuelweb_test/testrail/upload_cases_description.py @@ -16,7 +16,8 @@ import re from logging import DEBUG from optparse import OptionParser -from proboscis import TestProgram +from proboscis import TestPlan +from proboscis.decorators import DEFAULT_REGISTRY from builds import Build from fuelweb_test.run_tests import import_tests @@ -32,12 +33,15 @@ def get_tests_descriptions(milestone_id, tests_include, tests_exclude, groups, from system_test.tests.actions_base import ActionsBase import_tests() define_custom_groups() + plan = TestPlan.create_from_registry(DEFAULT_REGISTRY) + all_plan_tests = plan.tests[:] tests = [] for jenkins_suffix in groups: group = groups[jenkins_suffix] - for case in TestProgram(groups=[group]).cases: + plan.filter(group_names=[group]) + for case in plan.tests: if not case.entry.info.enabled: continue home = case.entry.home @@ -111,6 +115,9 @@ def get_tests_descriptions(milestone_id, tests_include, tests_exclude, groups, else: logger.warning("Testcase '{0}' run in multiple Jenkins jobs!" .format(test_group)) + + plan.tests = all_plan_tests[:] + return tests diff --git a/system_test/tests/base_actions_factory.py b/system_test/tests/base_actions_factory.py index ba6e4f5f0..2c4ec51ad 100644 --- a/system_test/tests/base_actions_factory.py +++ b/system_test/tests/base_actions_factory.py @@ -119,10 +119,7 @@ class BaseActionsFactory(base_test_case.TestBasic): finish_method) # Generate test case groups - groups = ['{}.{}'.format(g, case_group) for g in cls.base_group] - groups += ['{}({})'.format(g, case_group) for g in cls.base_group] - groups += ['{}[{}]'.format(g, case_group) for g in cls.base_group] - groups += ['{}{{{}}}'.format(g, case_group) for g in cls.base_group] + groups = ['{}({})'.format(g, case_group) for g in cls.base_group] groups = cls.base_group + groups # Generate test case docstring