CSIT-1183: Process the new and the old TC names 03/13403/7
authorTibor Frank <tifrank@cisco.com>
Tue, 10 Jul 2018 11:23:47 +0000 (13:23 +0200)
committerTibor Frank <tifrank@cisco.com>
Wed, 11 Jul 2018 06:17:02 +0000 (06:17 +0000)
Change-Id: I7fcecd7e23494e8fb0e70e7af00408eed16733e4
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/generator_CPTA.py
resources/tools/presentation/input_data_parser.py

index f96fab0..99fc821 100644 (file)
@@ -312,7 +312,6 @@ def _generate_all_charts(spec, input_data):
             csv_tbl.append("{0},".format(tst_name) + ",".join(tst_lst) + '\n')
         # Generate traces:
         traces = list()
             csv_tbl.append("{0},".format(tst_name) + ",".join(tst_lst) + '\n')
         # Generate traces:
         traces = list()
-        win_size = 14
         index = 0
         for test_name, test_data in chart_data.items():
             if not test_data:
         index = 0
         for test_name, test_data in chart_data.items():
             if not test_data:
index 57ec935..d3e83fd 100644 (file)
@@ -484,6 +484,7 @@ class ExecutionChecker(ResultVisitor):
         test_result["msg"] = test.message.replace('\n', ' |br| '). \
             replace('\r', '').replace('"', "'")
         test_result["status"] = test.status
         test_result["msg"] = test.message.replace('\n', ' |br| '). \
             replace('\r', '').replace('"', "'")
         test_result["status"] = test.status
+        self._test_ID = test.longname.lower()
         if test.status == "PASS" and ("NDRPDRDISC" in tags or
                                       "TCP" in tags or
                                       "MRR" in tags or
         if test.status == "PASS" and ("NDRPDRDISC" in tags or
                                       "TCP" in tags or
                                       "MRR" in tags or
@@ -503,6 +504,33 @@ class ExecutionChecker(ResultVisitor):
 
             test_result["type"] = test_type
 
 
             test_result["type"] = test_type
 
+            # Replace info about cores (e.g. -1c-) with the info about threads
+            # and cores (e.g. -1t1c-) in the long test case names and in the
+            # test case names if necessary.
+            groups = re.search(self.REGEX_TC_NAME_OLD, self._test_ID)
+            if not groups:
+                tag_count = 0
+                for tag in test_result["tags"]:
+                    groups = re.search(self.REGEX_TC_TAG, tag)
+                    if groups:
+                        tag_count += 1
+                        tag_tc = tag
+
+                if tag_count == 1:
+                    self._test_ID = re.sub(self.REGEX_TC_NAME_NEW,
+                                           "-{0}-".format(tag_tc.lower()),
+                                           self._test_ID,
+                                           count=1)
+                    test_result["name"] = re.sub(self.REGEX_TC_NAME_NEW,
+                                                 "-{0}-".format(tag_tc.lower()),
+                                                 test_result["name"],
+                                                 count=1)
+                else:
+                    test_result["status"] = "FAIL"
+                    logging.error("The test '{0}' has no or more than one "
+                                  "multi-threading tags.".format(self._test_ID))
+                    return
+
             if test_type in ("NDR", "PDR"):
                 try:
                     rate_value = str(re.search(
             if test_type in ("NDR", "PDR"):
                 try:
                     rate_value = str(re.search(
@@ -546,7 +574,6 @@ class ExecutionChecker(ResultVisitor):
                         AvgStdevMetadataFactory.from_data([
                             float(groups.group(3)) / float(groups.group(1)), ])
 
                         AvgStdevMetadataFactory.from_data([
                             float(groups.group(3)) / float(groups.group(1)), ])
 
-        self._test_ID = test.longname.lower()
         self._data["tests"][self._test_ID] = test_result
 
     def end_test(self, test):
         self._data["tests"][self._test_ID] = test_result
 
     def end_test(self, test):