Report: Detect outliers for the comparative tables 78/11378/1
authorTibor Frank <tifrank@cisco.com>
Mon, 26 Mar 2018 13:33:31 +0000 (15:33 +0200)
committerTibor Frank <tifrank@cisco.com>
Mon, 26 Mar 2018 13:33:31 +0000 (15:33 +0200)
Change-Id: Ia1be590a720df71ff51e8a7ca910ed27a4642209
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/pal.py
resources/tools/presentation/specification.yaml
resources/tools/presentation/specification_parser.py

index a43082d..98642c8 100644 (file)
@@ -87,48 +87,48 @@ def main():
         return 1
 
     ret_code = 0
-    #try:
-    env = Environment(spec.environment, args.force)
-    env.set_environment()
-
-    if spec.is_debug:
-        if spec.debug["input-format"] == "zip":
-            unzip_files(spec)
-    else:
-        download_data_files(spec)
-
-    prepare_static_content(spec)
-
-    data = InputData(spec)
-    data.read_data()
-
-    generate_tables(spec, data)
-    generate_plots(spec, data)
-    generate_files(spec, data)
-
-    if spec.output["output"] == "report":
-        generate_report(args.release, spec)
-        logging.info("Successfully finished.")
-    elif spec.output["output"] == "CPTA":
-        sys.stdout.write(generate_cpta(spec, data))
-        logging.info("Successfully finished.")
-    else:
-        logging.critical("The output '{0}' is not supported.".
-                         format(spec.output["output"]))
+    try:
+        env = Environment(spec.environment, args.force)
+        env.set_environment()
+
+        if spec.is_debug:
+            if spec.debug["input-format"] == "zip":
+                unzip_files(spec)
+        else:
+            download_data_files(spec)
+
+        prepare_static_content(spec)
+
+        data = InputData(spec)
+        data.read_data()
+
+        generate_tables(spec, data)
+        generate_plots(spec, data)
+        generate_files(spec, data)
+
+        if spec.output["output"] == "report":
+            generate_report(args.release, spec)
+            logging.info("Successfully finished.")
+        elif spec.output["output"] == "CPTA":
+            sys.stdout.write(generate_cpta(spec, data))
+            logging.info("Successfully finished.")
+        else:
+            logging.critical("The output '{0}' is not supported.".
+                             format(spec.output["output"]))
+            ret_code = 1
+
+    except (KeyError, ValueError, PresentationError) as err:
+        logging.info("Finished with an error.")
+        logging.critical(str(err))
         ret_code = 1
-
-    # except (KeyError, ValueError, PresentationError) as err:
-    #     logging.info("Finished with an error.")
-    #     logging.critical(str(err))
-    #     ret_code = 1
-    # except Exception as err:
-    #     logging.info("Finished with an unexpected error.")
-    #     logging.critical(str(err))
-    #     ret_code = 1
-    # finally:
-    #     if spec is not None and not spec.is_debug:
-    #         clean_environment(spec.environment)
-    #     return ret_code
+    except Exception as err:
+        logging.info("Finished with an unexpected error.")
+        logging.critical(str(err))
+        ret_code = 1
+    finally:
+        if spec is not None and not spec.is_debug:
+            clean_environment(spec.environment)
+        return ret_code
 
 
 if __name__ == '__main__':
index b8ee748..9d51d51 100644 (file)
 
 -
   type: "output"
+  output: "report"
   format:
     html:
     - full
index 7b7d35b..207507e 100644 (file)
@@ -489,10 +489,10 @@ class Specification(object):
                             # defined as a range <start, build_type>
                             build_nr = self._get_build_number(job, build_nr)
                         builds = [x for x in range(builds["start"], build_nr+1)]
-                        self._specification["input"]["builds"][job] = list()
-                        for build in builds:
-                            self._specification["input"]["builds"][job]. \
-                                append({"build": build, "status": None})
+                    self._specification["input"]["builds"][job] = list()
+                    for build in builds:
+                        self._specification["input"]["builds"][job]. \
+                            append({"build": build, "status": None})
 
                 else:
                     logging.warning("No build is defined for the job '{}'. "

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.