aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/core/robotframework.py
diff options
context:
space:
mode:
authorBellengé Maxime <maxime.bellenge@orange.com>2022-06-30 11:56:51 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2022-09-23 13:18:18 +0200
commit0e9f1fb341392881074b2d11830cf42a2bd2abf4 (patch)
treeb06b7bf31252a1023d6f393d48ac308d98f67304 /xtesting/core/robotframework.py
parent7e195ded9fa55e4c535b751fb9289f191b81c48c (diff)
Add deny_skipping parameter
It takes into account or not skip tests in the global result It also adds unit tests to cover it. It should be noted that if follows the deny skipping model proposed by Functest (tempest). Change-Id: I15fa7a3946c6e3b2ae190e4f8abf3b9361a391a4 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 4970d3bfe0e8e580beaa86ae7c41977e2e93ab3f)
Diffstat (limited to 'xtesting/core/robotframework.py')
-rw-r--r--xtesting/core/robotframework.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/xtesting/core/robotframework.py b/xtesting/core/robotframework.py
index 775ed1ce..2952de60 100644
--- a/xtesting/core/robotframework.py
+++ b/xtesting/core/robotframework.py
@@ -56,6 +56,7 @@ class RobotFramework(testcase.TestCase):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.xml_file = os.path.join(self.res_dir, 'output.xml')
+ self.deny_skipping = kwargs.get("deny_skipping", False)
def parse_results(self):
"""Parse output.xml and get the details in it."""
@@ -63,9 +64,15 @@ class RobotFramework(testcase.TestCase):
visitor = ResultVisitor()
result.visit(visitor)
try:
- self.result = 100 * (
- result.suite.statistics.passed /
- result.suite.statistics.total)
+ if self.deny_skipping:
+ self.result = 100 * (
+ result.suite.statistics.passed /
+ result.suite.statistics.total)
+ else:
+ self.result = 100 * ((
+ result.suite.statistics.passed +
+ result.suite.statistics.skipped) /
+ result.suite.statistics.total)
except ZeroDivisionError:
self.__logger.error("No test has been run")
self.start_time = timestamp_to_secs(result.suite.starttime)