]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
DEBUG: add logs and decode file data unit-test-xml
authorVallari Agrawal <val.agl002@gmail.com>
Sun, 23 Oct 2022 03:23:18 +0000 (08:53 +0530)
committerVallari Agrawal <val.agl002@gmail.com>
Mon, 31 Oct 2022 14:15:41 +0000 (19:45 +0530)
Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
teuthology/orchestra/run.py

index 80ecf598ea497a45b4ee8fef12f34fec0ad548df..0ec78430f1fff821ac4074e6b858a926348e96c9 100644 (file)
@@ -192,7 +192,8 @@ class RemoteProcess(object):
                     try:
                         error_msg = UnitTestFailure().get_error_msg(self.unittest_xml, self.client)
                     except Exception as exc:
-                        self.logger.error('Unable to scan logs, exception occurred: {exc}'.format(exc=repr(exc)))
+                        self.logger.exception(exc)
+                        # self.logger.error('Unable to scan logs, exception occurred: {exc}'.format(exc=repr(exc)))
                     if error_msg:
                         raise UnitTestError(
                             exitstatus=self.returncode, node=self.hostname, 
@@ -255,11 +256,12 @@ class UnitTestFailure():
             return "No XML file path was passed to process!"
         self.client = client
         error_message = None
+        log.info("XML_DEBUG: getting message...")
 
         if xmlfile_path[-1] == "/": # directory
             (_, stdout, _) = client.exec_command(f'ls -d {xmlfile_path}*.xml', timeout=200)
-            xml_files = stdout.read().split('\n')
-            log.info("XML_DEBUG: xml_files are " + xml_files)
+            xml_files = stdout.read().decode().split('\n')
+            log.info("XML_DEBUG: xml_files are " + " ".join(xml_files))
             
             for file in xml_files:
                 error = self._parse_xml(file)
@@ -324,6 +326,7 @@ class UnitTestFailure():
             else:
                 return f'XML output not found at `{str(xml_path)}`!'
         except Exception as exc:
+            log.exception(exc)
             raise Exception("Somthing went wrong while searching for error in XML file: " + repr(exc))
     
     def write_logs(self):
@@ -336,6 +339,7 @@ class UnitTestFailure():
                 yaml.safe_dump(self.yaml_data, remote_yaml_file, default_flow_style=False)
                 remote_yaml_file.close()
             except Exception as exc: 
+                log.exception(exc)
                 log.info("XML_DEBUG: write logs error: " + repr(exc))
         log.info("XML_DEBUG: yaml_data is empty!")