aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/ci
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-08-10 13:04:11 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-08-12 12:26:23 +0200
commit2ad07442cebfaca7d5d70191f9ffca1cabdf4370 (patch)
treeb31f5dc76f026b3a567361b3c6cb5c392acf59fb /xtesting/ci
parentf42e4276414e492afde19deb368c1e77d4dffbeb (diff)
Skip the selected testcase too0.35
It completes "Allow calling a skip test" [1] [1] https://gerrit.opnfv.org/gerrit/60655 Change-Id: I02499aed56e6b23563165ea1f17b476e12408823 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit a9491ef0948f8fe3eb3772b6b6ae44d86bde7e9b)
Diffstat (limited to 'xtesting/ci')
-rw-r--r--xtesting/ci/run_tests.py2
-rw-r--r--xtesting/ci/tier_builder.py3
-rw-r--r--xtesting/ci/tier_handler.py8
3 files changed, 9 insertions, 4 deletions
diff --git a/xtesting/ci/run_tests.py b/xtesting/ci/run_tests.py
index 27f9d946..255b74df 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 a4169099..3383a763 100644
--- a/xtesting/ci/tier_builder.py
+++ b/xtesting/ci/tier_builder.py
@@ -45,7 +45,6 @@ class TierBuilder(object):
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 = '.*'
@@ -60,6 +59,7 @@ class TierBuilder(object):
testcase = tier_handler.TestCase(
name=dic_testcase['case_name'],
enabled=dic_testcase.get('enabled', True),
+ skipped=False,
dependency=dep, criteria=dic_testcase['criteria'],
blocking=dic_testcase['blocking'],
description=dic_testcase['description'],
@@ -69,6 +69,7 @@ class TierBuilder(object):
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 51f031c0..4e413f51 100644
--- a/xtesting/ci/tier_handler.py
+++ b/xtesting/ci/tier_handler.py
@@ -100,14 +100,15 @@ class Tier(object):
return msg.get_string()
-class TestCase(object):
+class TestCase(object): # pylint: disable=too-many-instance-attributes
- def __init__(self, name, enabled, dependency, criteria, blocking,
+ def __init__(self, name, enabled, skipped, dependency, criteria, blocking,
description="", project=""):
# pylint: disable=too-many-arguments
self.name = name
self.enabled = enabled
self.dependency = dependency
+ self.skipped = skipped
self.criteria = criteria
self.blocking = blocking
self.description = description
@@ -129,6 +130,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