diff options
author | Tibor Frank <tifrank@cisco.com> | 2018-07-23 09:12:34 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2018-07-23 10:40:32 +0200 |
commit | eb9e73f37019420ff8387c204b6621e73195fd97 (patch) | |
tree | e3354c972a367ba3638f5e64d3926f917d655e63 /resources | |
parent | 5b444791a6be7d050632fb53b3404ffb57b66ff3 (diff) |
CSIT-1204: Make new TC names backward compatible (trending)
Change-Id: I48976a21ed022f0f8d840903db4d2415be9365cd
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources')
-rw-r--r-- | resources/tools/presentation/generator_CPTA.py | 2 | ||||
-rw-r--r-- | resources/tools/presentation/generator_tables.py | 6 | ||||
-rw-r--r-- | resources/tools/presentation/input_data_parser.py | 9 |
3 files changed, 11 insertions, 6 deletions
diff --git a/resources/tools/presentation/generator_CPTA.py b/resources/tools/presentation/generator_CPTA.py index 99fc82170a..7279ea345a 100644 --- a/resources/tools/presentation/generator_CPTA.py +++ b/resources/tools/presentation/generator_CPTA.py @@ -323,7 +323,7 @@ def _generate_all_charts(spec, input_data): test_data, job_name=job_name, build_info=build_info, - name='-'.join(test_name.split('-')[3:-1]), + name='-'.join(test_name.split('-')[2:-1]), color=COLORS[index]) traces.extend(trace) res.append(rslt) diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py index d42c734b95..5c38c1ebf1 100644 --- a/resources/tools/presentation/generator_tables.py +++ b/resources/tools/presentation/generator_tables.py @@ -718,8 +718,7 @@ def table_performance_trending_dashboard(table, input_data): continue if tbl_dict.get(tst_name, None) is None: name = "{0}-{1}".format(tst_data["parent"].split("-")[0], - "-".join(tst_data["name"]. - split("-")[1:])) + tst_data["name"]) tbl_dict[tst_name] = {"name": name, "data": OrderedDict()} try: @@ -987,8 +986,7 @@ def table_failed_tests(table, input_data): continue if tbl_dict.get(tst_name, None) is None: name = "{0}-{1}".format(tst_data["parent"].split("-")[0], - "-".join(tst_data["name"]. - split("-")[1:])) + tst_data["name"]) tbl_dict[tst_name] = {"name": name, "data": OrderedDict()} try: diff --git a/resources/tools/presentation/input_data_parser.py b/resources/tools/presentation/input_data_parser.py index f2660db120..e0393a8214 100644 --- a/resources/tools/presentation/input_data_parser.py +++ b/resources/tools/presentation/input_data_parser.py @@ -206,6 +206,8 @@ class ExecutionChecker(ResultVisitor): REGEX_TC_NAME_NEW = re.compile(r'-\d+[cC]-') + REGEX_TC_NUMBER = re.compile(r'tc[0-9]{2}-') + def __init__(self, metadata): """Initialisation. @@ -477,6 +479,9 @@ class ExecutionChecker(ResultVisitor): tags = [str(tag) for tag in test.tags] test_result = dict() test_result["name"] = test.name.lower() + # Remove TC number from the TC name (not needed): + test_result["name"] = re.sub(self.REGEX_TC_NUMBER, "", + test.name.lower()) test_result["parent"] = test.parent.name.lower() test_result["tags"] = tags doc_str = test.doc.replace('"', "'").replace('\n', ' '). \ @@ -485,7 +490,9 @@ class ExecutionChecker(ResultVisitor): test_result["msg"] = test.message.replace('\n', ' |br| '). \ replace('\r', '').replace('"', "'") test_result["status"] = test.status - self._test_ID = test.longname.lower() + # Remove TC number from the TC long name (backward compatibility): + self._test_ID = re.sub(self.REGEX_TC_NUMBER, "", test.longname.lower()) + if test.status == "PASS" and ("NDRPDRDISC" in tags or "TCP" in tags or "MRR" in tags or |