Alerts: Change the error message 14/18814/8
authorTibor Frank <tifrank@cisco.com>
Thu, 11 Apr 2019 12:28:00 +0000 (14:28 +0200)
committerTibor Frank <tifrank@cisco.com>
Mon, 15 Apr 2019 08:41:52 +0000 (10:41 +0200)
Change-Id: I0fcd6ffaf24de0f6ce95eaba3d591eddf3f16b33
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/generator_alerts.py
resources/tools/presentation/specification_CPTA.yaml
resources/tools/presentation_new/specification_CPTA.yaml

index b106d95..1b40dbb 100644 (file)
@@ -19,7 +19,7 @@ from email.mime.multipart import MIMEMultipart
 from os.path import isdir
 from collections import OrderedDict
 
-from utils import execute_command
+from utils import get_last_completed_build_number
 from errors import PresentationError
 
 
@@ -71,8 +71,10 @@ class Alerting(object):
         # Implemented alerts:
         self._ALERTS = ("failed-tests", )
 
+        self._spec = spec
+
         try:
-            self._spec = spec.alerting
+            self._spec_alert = spec.alerting
         except KeyError as err:
             raise  AlertingError("Alerting is not configured, skipped.",
                                  repr(err),
@@ -81,7 +83,7 @@ class Alerting(object):
         self._path_failed_tests = spec.environment["paths"]["DIR[STATIC,VPP]"]
 
         # Verify and validate input specification:
-        self.configs = self._spec.get("configurations", None)
+        self.configs = self._spec_alert.get("configurations", None)
         if not self.configs:
             raise AlertingError("No alert configuration is specified.")
         for config_type, config_data in self.configs.iteritems():
@@ -104,7 +106,7 @@ class Alerting(object):
                 raise AlertingError("Alert of type '{0}' is not implemented.".
                                     format(config_type))
 
-        self.alerts = self._spec.get("alerts", None)
+        self.alerts = self._spec_alert.get("alerts", None)
         if not self.alerts:
             raise AlertingError("No alert is specified.")
         for alert, alert_data in self.alerts.iteritems():
@@ -303,8 +305,16 @@ class Alerting(object):
             build, version, nr, failed_tests = \
                 self._get_compressed_failed_tests(alert, test_set)
             if build is None:
-                text += "\n\nNo data for the test set '{set}'.\n".\
-                    format(set=test_set)
+                ret_code, build_nr, _ = get_last_completed_build_number(
+                    self._spec.environment["urls"]["URL[JENKINS,CSIT]"],
+                    alert["urls"][idx].split('/')[-1])
+                if ret_code != 0:
+                    build_nr = ''
+                text += "\n\nNo input data available for '{set}'. See CSIT " \
+                        "build {link}/{build} for more information.\n".\
+                    format(set='-'.join(test_set.split('-')[-2:]),
+                           link=alert["urls"][idx],
+                           build=build_nr)
                 continue
             text += ("\n\n{topo}-{arch}, "
                      "{nr} tests failed, "
index cc6bb01..ada861d 100644 (file)
     # 3n-hsw
     plot-performance-trending-all-3n-hsw:
       csit-vpp-perf-mrr-daily-master:
-        start: 501
+        start: 510
         end: "lastCompletedBuild"
         skip:
           - 593
 
     plot-performance-trending-vpp-3n-hsw:
       csit-vpp-perf-mrr-daily-master:
-        start: 501
+        start: 510
         end: "lastCompletedBuild"
         skip:
           - 593
     # 3n-skx
     plot-performance-trending-all-3n-skx:
       csit-vpp-perf-mrr-daily-master-3n-skx:
-        start: 250
+        start: 260
         end: "lastCompletedBuild"
         skip:
           - 356
 
     plot-performance-trending-vpp-3n-skx:
       csit-vpp-perf-mrr-daily-master-3n-skx:
-        start: 250
+        start: 260
         end: "lastCompletedBuild"
         skip:
           - 356
     # 2n-skx
     plot-performance-trending-all-2n-skx:
       csit-vpp-perf-mrr-daily-master-2n-skx:
-        start: 250
+        start: 260
         end: "lastCompletedBuild"
         skip:
           - 347
 
     plot-performance-trending-vpp-2n-skx:
       csit-vpp-perf-mrr-daily-master-2n-skx:
-        start: 250
+        start: 260
         end: "lastCompletedBuild"
         skip:
           - 347
 
     # 3n-hsw
     csit-vpp-perf-mrr-daily-master:
-      start: 501
+      start: 510
       end: "lastCompletedBuild"
       skip:
         - 593
 
     # 3n-skx
     csit-vpp-perf-mrr-daily-master-3n-skx:
-      start: 250
+      start: 260
       end: "lastCompletedBuild"
       skip:
         - 356
 
     # 2n-skx
     csit-vpp-perf-mrr-daily-master-2n-skx:
-      start: 250
+      start: 260
       end: "lastCompletedBuild"
       skip:
         - 347
index b2e47fd..4412a7f 100644 (file)
@@ -84,7 +84,7 @@
     # 3n-hsw
     plot-performance-trending-all-3n-hsw:
       csit-vpp-perf-mrr-daily-master:
-        start: 500
+        start: 510
         end: "lastCompletedBuild"
       csit-dpdk-perf-mrr-weekly-master:
         start: 54
@@ -92,7 +92,7 @@
 
     plot-performance-trending-vpp-3n-hsw:
       csit-vpp-perf-mrr-daily-master:
-        start: 500
+        start: 510
         end: "lastCompletedBuild"
 
     plot-performance-trending-dpdk-3n-hsw:
     # 3n-skx
     plot-performance-trending-all-3n-skx:
       csit-vpp-perf-mrr-daily-master-3n-skx:
-        start: 250
+        start: 260
         end: "lastCompletedBuild"
       csit-dpdk-perf-mrr-weekly-master-3n-skx:
         start: 19
 
     plot-performance-trending-vpp-3n-skx:
       csit-vpp-perf-mrr-daily-master-3n-skx:
-        start: 250
+        start: 260
         end: "lastCompletedBuild"
 
     plot-performance-trending-dpdk-3n-skx:
     # 2n-skx
     plot-performance-trending-all-2n-skx:
       csit-vpp-perf-mrr-daily-master-2n-skx:
-        start: 250
+        start: 260
         end: "lastCompletedBuild"
       csit-dpdk-perf-mrr-weekly-master-2n-skx:
         start: 19
 
     plot-performance-trending-vpp-2n-skx:
       csit-vpp-perf-mrr-daily-master-2n-skx:
-        start: 250
+        start: 260
         end: "lastCompletedBuild"
 
     plot-performance-trending-dpdk-2n-skx:
 
     # 3n-hsw
     csit-vpp-perf-mrr-daily-master:
-      start: 500
+      start: 510
       end: "lastCompletedBuild"
     csit-dpdk-perf-mrr-weekly-master:
       start: 54
 
     # 3n-skx
     csit-vpp-perf-mrr-daily-master-3n-skx:
-      start: 250
+      start: 260
       end: "lastCompletedBuild"
     csit-dpdk-perf-mrr-weekly-master-3n-skx:
       start: 19
 
     # 2n-skx
     csit-vpp-perf-mrr-daily-master-2n-skx:
-      start: 250
+      start: 260
       end: "lastCompletedBuild"
     csit-dpdk-perf-mrr-weekly-master-2n-skx:
       start: 19

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.