aboutsummaryrefslogtreecommitdiffstats
path: root/functest_kubernetes
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2023-12-21 14:53:49 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2023-12-22 08:51:23 +0100
commit40103c87509d097749dfb211a712a120eb1dd188 (patch)
treec0a41d18ab0fa45833f561daa45bc9d9cd0c552f /functest_kubernetes
parent685c42fd0451d10cec03ddc6d595def1340cfe4a (diff)
Help Debugging when e2e result parsing fails
Change-Id: I7f153b0ddef25b0317d8e9a8b2dad55ab580b388 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit da0f27e6cc0a416e3a3a89639b7280836daf296d)
Diffstat (limited to 'functest_kubernetes')
-rw-r--r--functest_kubernetes/k8stest.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/functest_kubernetes/k8stest.py b/functest_kubernetes/k8stest.py
index 78fbdeb9..a2415e4f 100644
--- a/functest_kubernetes/k8stest.py
+++ b/functest_kubernetes/k8stest.py
@@ -88,7 +88,13 @@ class E2ETesting(testcase.TestCase):
r' ([0-9]+) Pending \| ([0-9]+) Skipped',
boutput.decode("utf-8", errors="ignore"),
re.MULTILINE | re.DOTALL)
- assert grp
+ try:
+ assert grp
+ except AssertionError:
+ self.__logger.exception(
+ "Can not find the overall result in \n%s",
+ boutput.decode("utf-8", errors="ignore"))
+ return False
self.details['passed'] = int(grp.group(2))
self.details['failed'] = int(grp.group(3))
self.details['pending'] = int(grp.group(4))
@@ -105,8 +111,10 @@ class E2ETesting(testcase.TestCase):
re.MULTILINE | re.DOTALL)
if grp2:
self.__logger.error(grp2.group(1))
+ return True
def run(self, **kwargs):
+ res = self.EX_RUN_ERROR
if not os.path.exists(self.res_dir):
os.makedirs(self.res_dir)
if not os.path.isfile(self.config):
@@ -115,11 +123,10 @@ class E2ETesting(testcase.TestCase):
return self.EX_RUN_ERROR
self.start_time = time.time()
try:
- self.run_kubetest(**kwargs)
- res = self.EX_OK
+ if self.run_kubetest(**kwargs):
+ res = self.EX_OK
except Exception: # pylint: disable=broad-except
self.__logger.exception("Error with running kubetest:")
- res = self.EX_RUN_ERROR
self.stop_time = time.time()
return res