Add extra factor of TC definition in testrail

We need to execute the upgrade tests for different chains of
MOS versions. And for the each run we need to store and process
test result in Testrail, but there is problem - the upgrade tests
for various MOS version have the same test group and for now
testrail reporter cannot tell apart them correctly, because
reporter does filter tests by test group parameter. So, we need
to add additional factor of Test Case definition into test report
mechanism

Change-Id: I1f4458a387f7dd9e8061a42023d1cb94c7028512
This commit is contained in:
Sergey Novikov 2016-09-13 14:34:54 +03:00
parent c25b2c4ace
commit 3b1431e810
4 changed files with 22 additions and 0 deletions

View File

@ -114,6 +114,11 @@ class TestRunStatistics(object):
if m:
tests_thread = m.group(1)
group = '{0}_{1}'.format(group, tests_thread)
elif TestRailSettings.extra_factor_of_tc_definition:
group = '{}_{}'.format(
group,
TestRailSettings.extra_factor_of_tc_definition
)
for test in self.tests:
if test['custom_test_group'] == group:
return test

View File

@ -216,6 +216,11 @@ def expand_test_group(group, systest_build_name, os):
if systest_group_name:
group = '_'.join([group, systest_group_name])
elif TestRailSettings.extra_factor_of_tc_definition:
group = '{}_{}'.format(
group,
TestRailSettings.extra_factor_of_tc_definition
)
return group

View File

@ -82,3 +82,6 @@ class TestRailSettings(object):
'blocked': ['blocked']
}
max_results_per_request = 250
extra_factor_of_tc_definition = os.environ.get(
'EXTRA_FACTOR_OF_TC_DEFINITION', None)

View File

@ -76,6 +76,15 @@ def get_tests_descriptions(milestone_id, tests_include, tests_exclude, groups,
title = ' - '.join([title, jenkins_suffix])
test_group = '_'.join([case.entry.home.func_name,
jenkins_suffix])
elif TestRailSettings.extra_factor_of_tc_definition:
title = '{} - {}'.format(
title,
TestRailSettings.extra_factor_of_tc_definition
)
test_group = '{}_{}'.format(
test_group,
TestRailSettings.extra_factor_of_tc_definition
)
test_case = {
"title": title,