diff options
author | Vratko Polak <vrpolak@cisco.com> | 2018-08-15 09:51:40 +0200 |
---|---|---|
committer | Vratko Polak <vrpolak@cisco.com> | 2018-08-15 09:51:40 +0200 |
commit | 399b58fe776d7b97ddf098d28093ad49c089aaea (patch) | |
tree | 2a85be26a852db52bbdb6f2f1314dd958b5aa1da | |
parent | 8eac1a77ab176f34f2726b4526e789576e84bda4 (diff) |
PAL: Log and continue when out of colors
Previously, IndexError happened in worker, getting the job stuck.
Graphs should not need that many colors, so there is a bug to fix still.
Change-Id: I1af415119cf06004be5febbd03636f847a7001be
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
-rw-r--r-- | resources/tools/presentation/generator_CPTA.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/resources/tools/presentation/generator_CPTA.py b/resources/tools/presentation/generator_CPTA.py index 7279ea345a..a4459bc003 100644 --- a/resources/tools/presentation/generator_CPTA.py +++ b/resources/tools/presentation/generator_CPTA.py @@ -318,13 +318,21 @@ def _generate_all_charts(spec, input_data): logs.append(("WARNING", "No data for the test '{0}'". format(test_name))) continue + message = "index: {index}, test: {test}".format( + index=index, test=test_name) test_name = test_name.split('.')[-1] - trace, rslt = _generate_trending_traces( - test_data, - job_name=job_name, - build_info=build_info, - name='-'.join(test_name.split('-')[2:-1]), - color=COLORS[index]) + try: + trace, rslt = _generate_trending_traces( + test_data, + job_name=job_name, + build_info=build_info, + name='-'.join(test_name.split('-')[2:-1]), + color=COLORS[index]) + except IndexError: + message = "Out of colors: {}".format(message) + logs.append(("ERROR", message)) + logging.error(message) + continue traces.extend(trace) res.append(rslt) index += 1 |