Trending: Add DPDK version to alerts 00/28600/1
authorTibor Frank <tifrank@cisco.com>
Fri, 28 Aug 2020 08:37:29 +0000 (10:37 +0200)
committerTibor Frank <tifrank@cisco.com>
Fri, 28 Aug 2020 08:37:29 +0000 (10:37 +0200)
Change-Id: I2f1a16ecfa0336e9c5a52a2efcbfcb2caddee089
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/generator_alerts.py
resources/tools/presentation/input_data_parser.py

index c6446f8..da45d75 100644 (file)
@@ -348,17 +348,20 @@ class Alerting:
 
         text = u""
         for idx, test_set in enumerate(alert.get(u"include", list())):
+            test_set_short = u""
+            device = u""
             try:
-                test_set_short = re.search(
+                groups = re.search(
                     re.compile(r'((vpp|dpdk)-\dn-(skx|clx|hsw|tsh|dnv)-.*)'),
                     test_set
-                ).group(1)
+                )
+                test_set_short = groups.group(1)
+                device = groups.group(2)
             except (AttributeError, IndexError):
                 logging.error(
                     f"The test set {test_set} does not include information "
                     f"about test bed. Using empty string instead."
                 )
-                test_set_short = u""
             build, version, passed, failed, failed_tests = \
                 self._get_compressed_failed_tests(alert, test_set)
             if build is None:
@@ -376,7 +379,7 @@ class Alerting:
             text += (
                 f"\n\n{test_set_short}, {failed} tests failed, {passed} tests "
                 f"passed, CSIT build: {alert[u'urls'][idx]}/{build}, "
-                f"VPP version: {version}\n\n"
+                f"{device} version: {version}\n\n"
             )
 
             class MaxLens():
@@ -427,7 +430,7 @@ class Alerting:
             gression_hdr = (
                 f"\n\n{test_set_short}, "
                 f"CSIT build: {alert[u'urls'][idx]}/{build}, "
-                f"VPP version: {version}\n\n"
+                f"{device} version: {version}\n\n"
             )
             # Add list of regressions:
             self._list_gressions(alert, idx, gression_hdr, u"regressions")
index 0a6efc7..250032e 100644 (file)
@@ -530,8 +530,8 @@ class ExecutionChecker(ResultVisitor):
         """
 
         if msg.message.count(u"return STDOUT Version:") or \
-            msg.message.count(u"VPP Version:") or \
-            msg.message.count(u"VPP version:"):
+                msg.message.count(u"VPP Version:") or \
+                msg.message.count(u"VPP version:"):
             self._version = str(re.search(self.REGEX_VERSION_VPP, msg.message).
                                 group(2))
             self._data[u"metadata"][u"version"] = self._version
@@ -1232,9 +1232,6 @@ class ExecutionChecker(ResultVisitor):
                 test_kw.name.count(u"Show Runtime Counters On All Duts"):
             self._msg_type = u"test-show-runtime"
             self._sh_run_counter += 1
-        elif test_kw.name.count(u"Install Dpdk Test On All Duts") and \
-                not self._version:
-            self._msg_type = u"dpdk-version"
         else:
             return
         test_kw.messages.visit(self)
@@ -1271,6 +1268,9 @@ class ExecutionChecker(ResultVisitor):
         if setup_kw.name.count(u"Show Vpp Version On All Duts") \
                 and not self._version:
             self._msg_type = u"vpp-version"
+        elif setup_kw.name.count(u"Install Dpdk Framework On All Duts") and \
+                not self._version:
+            self._msg_type = u"dpdk-version"
         elif setup_kw.name.count(u"Set Global Variable") \
                 and not self._timestamp:
             self._msg_type = u"timestamp"