From 1d4bc8a050e4f697b4b73867462ea756d4b4c262 Mon Sep 17 00:00:00 2001 From: Artem Panchenko Date: Mon, 30 Nov 2015 16:33:31 +0200 Subject: [PATCH] Fix template based tests cases upload to TestRail Some changes were added to the tests framework (template based) which broke cases generation during upload to TestRail. This patch aligns TestRail script with current tests implementation. Change-Id: I4ba879bb841faea21f219a19baa8ccb36491bcb9 Closes-bug: #1521147 --- fuelweb_test/testrail/upload_cases_description.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fuelweb_test/testrail/upload_cases_description.py b/fuelweb_test/testrail/upload_cases_description.py index 3ee8c0018..4bec9f2b9 100644 --- a/fuelweb_test/testrail/upload_cases_description.py +++ b/fuelweb_test/testrail/upload_cases_description.py @@ -20,6 +20,7 @@ from proboscis import TestProgram from builds import Build from fuelweb_test.run_tests import import_tests +from fuelweb_test.run_tests import define_custom_groups from settings import GROUPS_TO_EXPAND from settings import logger from settings import TestRailSettings @@ -30,6 +31,7 @@ def get_tests_descriptions(milestone_id, tests_include, tests_exclude, groups, default_test_priority): from system_test.tests.actions_base import ActionsBase import_tests() + define_custom_groups() tests = [] @@ -39,6 +41,9 @@ def get_tests_descriptions(milestone_id, tests_include, tests_exclude, groups, if not case.entry.info.enabled: continue home = case.entry.home + if not hasattr(case.entry, 'parent'): + # Not a real case, some stuff needed by template based tests + continue parent_home = case.entry.parent.home case_state = case.state if issubclass(parent_home, ActionsBase): @@ -66,6 +71,7 @@ def get_tests_descriptions(milestone_id, tests_include, tests_exclude, groups, if issubclass(parent_home, ActionsBase): docstring = parent_home.__doc__.split('\n') + case_state.instance._load_config() configuration = case_state.instance.config_name docstring[0] = "{0} on {1}".format(docstring[0], configuration) docstring = '\n'.join(docstring)