X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_cpta.py;h=4b10440257bd338d030d2cfc3bd68c1d4a877fed;hp=43adba744a71f4af38ad6131cf7dbc9609f2d943;hb=1da19da813655f643bc3c6e4d03bed987f076f07;hpb=093e1a0bfa7257048e6d12fe9fc9fbf1a9f98e49 diff --git a/resources/tools/presentation/generator_cpta.py b/resources/tools/presentation/generator_cpta.py index 43adba744a..4b10440257 100644 --- a/resources/tools/presentation/generator_cpta.py +++ b/resources/tools/presentation/generator_cpta.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -31,7 +31,7 @@ from pal_utils import archive_input_data, execute_command, classify_anomalies # Command to build the html format of the report -HTML_BUILDER = u'sphinx-build -v -c conf_cpta -a ' \ +HTML_BUILDER = u'sphinx-build -v -c sphinx_conf/trending -a ' \ u'-b html -E ' \ u'-t html ' \ u'-D version="{date}" ' \ @@ -149,7 +149,7 @@ def generate_cpta(spec, data): css_file: css_file.write(THEME_OVERRIDES) - if spec.configuration.get(u"archive-inputs", True): + if spec.environment.get(u"archive-inputs", False): archive_input_data(spec) logging.info(u"Done.") @@ -244,7 +244,12 @@ def _generate_trending_traces(in_data, job_name, build_info, for key, value in zip(xaxis, data_y_pps): data_pd[key] = value - anomaly_classification, avgs_pps, stdevs_pps = classify_anomalies(data_pd) + try: + anomaly_classification, avgs_pps, stdevs_pps = \ + classify_anomalies(data_pd) + except ValueError as err: + logging.info(f"{err} Skipping") + return avgs_mpps = [avg_pps / 1e6 for avg_pps in avgs_pps] stdevs_mpps = [stdev_pps / 1e6 for stdev_pps in stdevs_pps] @@ -600,12 +605,12 @@ def _generate_all_charts(spec, input_data): return return_lst builds_dict = dict() - for job in spec.input[u"builds"].keys(): + for job, builds in spec.input.items(): if builds_dict.get(job, None) is None: builds_dict[job] = list() - for build in spec.input[u"builds"][job]: - status = build[u"status"] - if status not in (u"failed", u"not found", u"removed", None): + for build in builds: + if build[u"status"] not in (u"failed", u"not found", u"removed", + None): builds_dict[job].append(str(build[u"build"])) # Create "build ID": "date" dict: