diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-12 10:48:17 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-12 16:12:56 +0200 |
commit | 3030d25d2a25347b0b6c7fcdd14bfe31fc5a86b6 (patch) | |
tree | 045a0cfc89ddc1b9888d05286d2a92eeecf043d0 /xtesting/ci/tier_builder.py | |
parent | a507f38dc69019523ff02006622eb4ab84cd5ba1 (diff) |
Skip testcases by any env var0.51
It also removes CI_LOOP which is releng centric.
It can be passed as dependency if required.
Change-Id: I146bb97950cb88062451158b7cc6a16c7f9d47a2
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/ci/tier_builder.py')
-rw-r--r-- | xtesting/ci/tier_builder.py | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/xtesting/ci/tier_builder.py b/xtesting/ci/tier_builder.py index a4169099..42909810 100644 --- a/xtesting/ci/tier_builder.py +++ b/xtesting/ci/tier_builder.py @@ -9,6 +9,7 @@ """TierBuilder class to parse testcases config file""" +import re import yaml from xtesting.ci import tier_handler @@ -43,34 +44,32 @@ class TierBuilder(object): for dic_tier in self.dic_tier_array: tier = tier_handler.Tier( name=dic_tier['name'], order=dic_tier['order'], - ci_loop=dic_tier['ci_loop'], description=dic_tier['description']) for dic_testcase in dic_tier['testcases']: - if not dic_testcase.get('dependencies'): - installer = '.*' - scenario = '.*' - else: - installer = dic_testcase['dependencies'].get( - 'installer', '.*') - scenario = dic_testcase['dependencies'].get( - 'scenario', '.*') - dep = tier_handler.Dependency(installer, scenario) - testcase = tier_handler.TestCase( name=dic_testcase['case_name'], enabled=dic_testcase.get('enabled', True), - dependency=dep, criteria=dic_testcase['criteria'], + criteria=dic_testcase['criteria'], blocking=dic_testcase['blocking'], description=dic_testcase['description'], project=dic_testcase['project_name']) - if (testcase.is_compatible(self.ci_installer, - self.ci_scenario) and - testcase.is_enabled()): - tier.add_test(testcase) + if not dic_testcase.get('dependencies'): + if testcase.is_enabled(): + tier.add_test(testcase) + else: + tier.skip_test(testcase) else: - tier.skip_test(testcase) - + for dependency in dic_testcase['dependencies']: + kenv = dependency.keys()[0] + if not re.search(dependency[kenv], env.get(kenv)): + tier.skip_test(testcase) + break + else: + if testcase.is_enabled(): + tier.add_test(testcase) + else: + tier.skip_test(testcase) self.tier_objects.append(tier) def get_tiers(self): |