aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/ci
diff options
context:
space:
mode:
Diffstat (limited to 'xtesting/ci')
-rw-r--r--xtesting/ci/run_tests.py2
-rw-r--r--xtesting/ci/tier_builder.py5
-rw-r--r--xtesting/ci/tier_handler.py6
3 files changed, 10 insertions, 3 deletions
diff --git a/xtesting/ci/run_tests.py b/xtesting/ci/run_tests.py
index 61482d98..59ed5617 100644
--- a/xtesting/ci/run_tests.py
+++ b/xtesting/ci/run_tests.py
@@ -138,7 +138,7 @@ class Runner(object):
def run_test(self, test):
"""Run one test case"""
- if not test.is_enabled():
+ if not test.is_enabled() or test.is_skipped():
msg = prettytable.PrettyTable(
header_style='upper', padding_width=5,
field_names=['test case', 'project', 'duration',
diff --git a/xtesting/ci/tier_builder.py b/xtesting/ci/tier_builder.py
index 42909810..66ad3250 100644
--- a/xtesting/ci/tier_builder.py
+++ b/xtesting/ci/tier_builder.py
@@ -45,11 +45,11 @@ class TierBuilder(object):
tier = tier_handler.Tier(
name=dic_tier['name'], order=dic_tier['order'],
description=dic_tier['description'])
-
for dic_testcase in dic_tier['testcases']:
testcase = tier_handler.TestCase(
name=dic_testcase['case_name'],
enabled=dic_testcase.get('enabled', True),
+ skipped=False,
criteria=dic_testcase['criteria'],
blocking=dic_testcase['blocking'],
description=dic_testcase['description'],
@@ -58,17 +58,20 @@ class TierBuilder(object):
if testcase.is_enabled():
tier.add_test(testcase)
else:
+ testcase.skipped = True
tier.skip_test(testcase)
else:
for dependency in dic_testcase['dependencies']:
kenv = dependency.keys()[0]
if not re.search(dependency[kenv], env.get(kenv)):
+ testcase.skipped = True
tier.skip_test(testcase)
break
else:
if testcase.is_enabled():
tier.add_test(testcase)
else:
+ testcase.skipped = True
tier.skip_test(testcase)
self.tier_objects.append(tier)
diff --git a/xtesting/ci/tier_handler.py b/xtesting/ci/tier_handler.py
index 11a0858e..ce9685be 100644
--- a/xtesting/ci/tier_handler.py
+++ b/xtesting/ci/tier_handler.py
@@ -97,11 +97,12 @@ class Tier(object):
class TestCase(object):
- def __init__(self, name, enabled, criteria, blocking,
+ def __init__(self, name, enabled, skipped, criteria, blocking,
description="", project=""):
# pylint: disable=too-many-arguments
self.name = name
self.enabled = enabled
+ self.skipped = skipped
self.criteria = criteria
self.blocking = blocking
self.description = description
@@ -113,6 +114,9 @@ class TestCase(object):
def is_enabled(self):
return self.enabled
+ def is_skipped(self):
+ return self.skipped
+
def get_criteria(self):
return self.criteria