Trending: CSIT-1717: Add links from dashboard to graphs 14/27114/9
authorTibor Frank <tifrank@cisco.com>
Mon, 18 May 2020 06:16:52 +0000 (08:16 +0200)
committerTibor Frank <tifrank@cisco.com>
Tue, 19 May 2020 04:50:54 +0000 (04:50 +0000)
+ fix TB names in alerts

Change-Id: Ia10e9b82b57e90f7ae4592bd6ecf8b71dea71cc8
Signed-off-by: Tibor Frank <tifrank@cisco.com>
docs/cpta/trending/ip4-2n-clx-cx556a.rst
docs/cpta/trending/ip4-2n-skx-xxv710.rst
docs/cpta/trending/ip4-3n-skx-xxv710.rst
docs/cpta/trending/ip4-3n-tsh-x520.rst
docs/cpta/trending/l2-3n-skx-xxv710.rst
docs/cpta/trending/l2-3n-tsh-x520.rst
resources/tools/presentation/generator_alerts.py
resources/tools/presentation/generator_tables.py
resources/tools/presentation/specification_CPTA.yaml

index 3a18fd5..6bff3ef 100644 (file)
 .. raw:: html
 
     <a name="64b-2t1c-features-rdma"></a>
+    <a name="64b-2t1c-features-iacl50-rdma"></a>
+    <a name="64b-2t1c-features-udp-rdma"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
 .. raw:: html
 
     <a name="64b-4t2c-features-rdma"></a>
+    <a name="64b-4t2c-features-iacl50-rdma"></a>
+    <a name="64b-4t2c-features-udp-rdma"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
 .. raw:: html
 
     <a name="64b-8t4c-features-rdma"></a>
+    <a name="64b-8t4c-features-iacl50-rdma"></a>
+    <a name="64b-8t4c-features-udp-rdma"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
index da3d3fb..787efdc 100644 (file)
 .. raw:: html
 
     <a name="64b-2t1c-features-avf"></a>
+    <a name="64b-2t1c-features-iacl50-avf"></a>
+    <a name="64b-2t1c-features-oacl50-avf"></a>
+    <a name="64b-2t1c-features-udp-avf"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
 .. raw:: html
 
     <a name="64b-4t2c-features-avf"></a>
+    <a name="64b-4t2c-features-iacl50-avf"></a>
+    <a name="64b-4t2c-features-oacl50-avf"></a>
+    <a name="64b-4t2c-features-udp-avf"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
 .. raw:: html
 
     <a name="64b-8t4c-features-avf"></a>
+    <a name="64b-8t4c-features-iacl50-avf"></a>
+    <a name="64b-8t4c-features-oacl50-avf"></a>
+    <a name="64b-8t4c-features-udp-avf"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
index 1e943bd..fb1680f 100644 (file)
 .. raw:: html
 
     <a name="64b-2t1c-features-avf"></a>
+    <a name="64b-2t1c-features-iacl50-avf"></a>
+    <a name="64b-2t1c-features-oacl50-avf"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
 .. raw:: html
 
     <a name="64b-4t2c-features-avf"></a>
+    <a name="64b-4t2c-features-iacl50-avf"></a>
+    <a name="64b-4t2c-features-oacl50-avf"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
 .. raw:: html
 
     <a name="64b-8t4c-features-avf"></a>
+    <a name="64b-8t4c-features-iacl50-avf"></a>
+    <a name="64b-8t4c-features-oacl50-avf"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
index 54731f2..da2ee44 100644 (file)
@@ -58,6 +58,9 @@
 .. raw:: html
 
     <a name="64b-1t1c-features-ixgbe"></a>
+    <a name="64b-1t1c-features-iacl50-ixgbe"></a>
+    <a name="64b-1t1c-features-oacl50-ixgbe"></a>
+    <a name="64b-1t1c-features-udp-ixgbe"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
@@ -72,6 +75,9 @@
 .. raw:: html
 
     <a name="64b-2t2c-features-ixgbe"></a>
+    <a name="64b-2t2c-features-iacl50-ixgbe"></a>
+    <a name="64b-2t2c-features-oacl50-ixgbe"></a>
+    <a name="64b-2t2c-features-udp-ixgbe"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
@@ -86,6 +92,9 @@
 .. raw:: html
 
     <a name="64b-4t4c-features-ixgbe"></a>
+    <a name="64b-4t4c-features-iacl50-ixgbe"></a>
+    <a name="64b-4t4c-features-oacl50-ixgbe"></a>
+    <a name="64b-4t4c-features-udp-ixgbe"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
index 8006363..93dbe05 100644 (file)
 .. raw:: html
 
     <a name="64b-2t1c-features-avf"></a>
+    <a name="64b-2t1c-features-iacl50-avf"></a>
+    <a name="64b-2t1c-features-oacl50-avf"></a>
+    <a name="64b-2t1c-features-macip-iacl50-avf"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
 .. raw:: html
 
     <a name="64b-4t2c-features-avf"></a>
+    <a name="64b-4t2c-features-iacl50-avf"></a>
+    <a name="64b-4t2c-features-oacl50-avf"></a>
+    <a name="64b-4t2c-features-macip-iacl50-avf"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
 .. raw:: html
 
     <a name="64b-8t4c-features-avf"></a>
+    <a name="64b-8t4c-features-iacl50-avf"></a>
+    <a name="64b-8t4c-features-oacl50-avf"></a>
+    <a name="64b-8t4c-features-macip-iacl50-avf"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
index 5444526..12cb7fe 100644 (file)
 .. raw:: html
 
     <a name="64b-1t1c-features-ixgbe"></a>
+    <a name="64b-1t1c-features-iacl50-ixgbe"></a>
+    <a name="64b-1t1c-features-oacl50-ixgbe"></a>
+    <a name="64b-1t1c-features-macip-iacl50-ixgbe"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
 .. raw:: html
 
     <a name="64b-2t2c-features-ixgbe"></a>
+    <a name="64b-2t2c-features-iacl50-ixgbe"></a>
+    <a name="64b-2t2c-features-oacl50-ixgbe"></a>
+    <a name="64b-2t2c-features-macip-iacl50-ixgbe"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
 .. raw:: html
 
     <a name="64b-4t4c-features-ixgbe"></a>
+    <a name="64b-4t4c-features-iacl50-ixgbe"></a>
+    <a name="64b-4t4c-features-oacl50-ixgbe"></a>
+    <a name="64b-4t4c-features-macip-iacl50-ixgbe"></a>
     <center>
     Links to builds:
     <a href="https://packagecloud.io/app/fdio/master/search?dist=ubuntu%2Fbionic" target="_blank">vpp-ref</a>,
index b0606b6..8e4f31e 100644 (file)
@@ -20,6 +20,7 @@
 
 import smtplib
 import logging
+import re
 
 from email.mime.text import MIMEText
 from email.mime.multipart import MIMEMultipart
@@ -346,7 +347,18 @@ class Alerting:
             )
 
         text = u""
-        for idx, test_set in enumerate(alert.get(u"include", [])):
+        for idx, test_set in enumerate(alert.get(u"include", list())):
+            try:
+                test_set_short = re.search(
+                    re.compile(r'(\dn-(skx|clx|hsw|tsh|dnv)-.*)'),
+                    test_set
+                ).group(1)
+            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:
@@ -356,16 +368,15 @@ class Alerting:
                 if ret_code != 0:
                     build_nr = u''
                 text += (
-                    f"\n\nNo input data available for "
-                    f"{u'-'.join(test_set.split('-')[-2:])}. See CSIT build "
-                    f"{alert[u'urls'][idx]}/{build_nr} for more information.\n"
+                    f"\n\nNo input data available for {test_set_short}. "
+                    f"See CSIT build {alert[u'urls'][idx]}/{build_nr} for more "
+                    f"information.\n"
                 )
                 continue
             text += (
-                f"\n\n{test_set.split('-')[-2]}-{test_set.split('-')[-1]}, "
-                f"{failed} tests failed, "
-                f"{passed} tests passed, CSIT build: "
-                f"{alert[u'urls'][idx]}/{build}, VPP version: {version}\n\n"
+                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"
             )
 
             class MaxLens():
@@ -414,7 +425,7 @@ class Alerting:
                 )
 
             gression_hdr = (
-                f"\n\n{test_set.split(u'-')[-2]}-{test_set.split(u'-')[-1]}, "
+                f"\n\n{test_set_short}, "
                 f"CSIT build: {alert[u'urls'][idx]}/{build}, "
                 f"VPP version: {version}\n\n"
             )
index 2644eb0..b048105 100644 (file)
@@ -1015,11 +1015,35 @@ def _generate_url(testbed, test_name):
     else:
         driver = u"dpdk"
 
-    if u"acl" in test_name or \
-            u"macip" in test_name or \
-            u"nat" in test_name or \
-            u"policer" in test_name or \
-            u"cop" in test_name:
+    if u"macip-iacl1s" in test_name:
+        bsf = u"features-macip-iacl1"
+    elif u"macip-iacl10s" in test_name:
+        bsf = u"features-macip-iacl01"
+    elif u"macip-iacl50s" in test_name:
+        bsf = u"features-macip-iacl50"
+    elif u"iacl1s" in test_name:
+        bsf = u"features-iacl1"
+    elif u"iacl10s" in test_name:
+        bsf = u"features-iacl10"
+    elif u"iacl50s" in test_name:
+        bsf = u"features-iacl50"
+    elif u"oacl1s" in test_name:
+        bsf = u"features-oacl1"
+    elif u"oacl10s" in test_name:
+        bsf = u"features-oacl10"
+    elif u"oacl50s" in test_name:
+        bsf = u"features-oacl50"
+    elif u"udpsrcscale" in test_name:
+        bsf = u"features-udp"
+    elif u"iacl" in test_name:
+        bsf = u"features"
+    elif u"policer" in test_name:
+        bsf = u"features"
+    elif u"cop" in test_name:
+        bsf = u"features"
+    elif u"nat" in test_name:
+        bsf = u"features"
+    elif u"macip" in test_name:
         bsf = u"features"
     elif u"scale" in test_name:
         bsf = u"scale"
@@ -1093,10 +1117,25 @@ def table_perf_trending_dash_html(table, input_data):
     if not table.get(u"testbed", None):
         logging.error(
             f"The testbed is not defined for the table "
-            f"{table.get(u'title', u'')}."
+            f"{table.get(u'title', u'')}. Skipping."
         )
         return
 
+    test_type = table.get(u"test-type", u"MRR")
+    if test_type not in (u"MRR", u"NDR", u"PDR"):
+        logging.error(
+            f"Test type {table.get(u'test-type', u'MRR')} is not defined. "
+            f"Skipping."
+        )
+        return
+
+    if test_type in (u"NDR", u"PDR"):
+        lnk_dir = u"../ndrpdr_trending/"
+        lnk_sufix = f"-{test_type.lower()}"
+    else:
+        lnk_dir = u"../trending/"
+        lnk_sufix = u""
+
     logging.info(f"  Generating the table {table.get(u'title', u'')} ...")
 
     try:
@@ -1161,8 +1200,9 @@ def table_perf_trending_dash_html(table, input_data):
                     tdata,
                     u"a",
                     attrib=dict(
-                        href=f"../trending/"
+                        href=f"{lnk_dir}"
                              f"{_generate_url(table.get(u'testbed', ''), item)}"
+                             f"{lnk_sufix}"
                     )
                 )
                 ref.text = item
@@ -1368,10 +1408,25 @@ def table_failed_tests_html(table, input_data):
     if not table.get(u"testbed", None):
         logging.error(
             f"The testbed is not defined for the table "
-            f"{table.get(u'title', u'')}."
+            f"{table.get(u'title', u'')}. Skipping."
         )
         return
 
+    test_type = table.get(u"test-type", u"MRR")
+    if test_type not in (u"MRR", u"NDR", u"PDR", u"NDRPDR"):
+        logging.error(
+            f"Test type {table.get(u'test-type', u'MRR')} is not defined. "
+            f"Skipping."
+        )
+        return
+
+    if test_type in (u"NDRPDR", u"NDR", u"PDR"):
+        lnk_dir = u"../ndrpdr_trending/"
+        lnk_sufix = u"-pdr"
+    else:
+        lnk_dir = u"../trending/"
+        lnk_sufix = u""
+
     logging.info(f"  Generating the table {table.get(u'title', u'')} ...")
 
     try:
@@ -1413,13 +1468,14 @@ def table_failed_tests_html(table, input_data):
                 attrib=dict(align=u"left" if c_idx == 0 else u"center")
             )
             # Name:
-            if c_idx == 0:
+            if c_idx == 0 and table.get(u"add-links", True):
                 ref = ET.SubElement(
                     tdata,
                     u"a",
                     attrib=dict(
-                        href=f"../trending/"
+                        href=f"{lnk_dir}"
                              f"{_generate_url(table.get(u'testbed', ''), item)}"
+                             f"{lnk_sufix}"
                     )
                 )
                 ref.text = item
index d28bcb7..fa41ab4 100644 (file)
         type: "failed-tests"
         way: "jenkins"
         include:
-          - "last-failed-tests-2n-skx"
-          - "last-failed-tests-3n-skx"
-          - "last-failed-tests-2n-clx"
-          - "last-failed-tests-3n-hsw"
-          - "last-failed-tests-3n-tsh"
-          - "last-failed-tests-2n-dnv"
-          - "last-failed-tests-3n-dnv"
+          - "last-failed-tests-2n-skx-mrr"
+          - "last-failed-tests-3n-skx-mrr"
+          - "last-failed-tests-2n-clx-mrr"
+          - "last-failed-tests-3n-hsw-mrr"
+          - "last-failed-tests-3n-tsh-mrr"
+          - "last-failed-tests-2n-dnv-mrr"
+          - "last-failed-tests-3n-dnv-mrr"
           - "last-failed-tests-2n-skx-ndrpdr"
           - "last-failed-tests-3n-skx-ndrpdr"
           - "last-failed-tests-2n-clx-ndrpdr"
   title: "Last failed tests (last builds) 3n-hsw"
   algorithm: "table_last_failed_tests"
   output-file-ext: ".txt"
-  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-3n-hsw"
+  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-3n-hsw-mrr"
   data: "table-last-failed-tests-3n-hsw"
   filter: "'MRR'"
   parameters:
   title: "Last failed tests (last builds) 3n-skx"
   algorithm: "table_last_failed_tests"
   output-file-ext: ".txt"
-  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-3n-skx"
+  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-3n-skx-mrr"
   data: "table-last-failed-tests-3n-skx"
   filter: "'MRR'"
   parameters:
   title: "Last failed tests (last builds) 2n-skx"
   algorithm: "table_last_failed_tests"
   output-file-ext: ".txt"
-  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-2n-skx"
+  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-2n-skx-mrr"
   data: "table-last-failed-tests-2n-skx"
   filter: "'MRR'"
   parameters:
   title: "Last failed tests (last builds) 2n-clx"
   algorithm: "table_last_failed_tests"
   output-file-ext: ".txt"
-  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-2n-clx"
+  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-2n-clx-mrr"
   data: "table-last-failed-tests-2n-clx"
   filter: "'MRR'"
   parameters:
   title: "Last failed tests (last builds) 3n-tsh"
   algorithm: "table_last_failed_tests"
   output-file-ext: ".txt"
-  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-3n-tsh"
+  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-3n-tsh-mrr"
   data: "table-last-failed-tests-3n-tsh"
   filter: "'MRR'"
   parameters:
   title: "Last failed tests (last builds) 3n-dnv"
   algorithm: "table_last_failed_tests"
   output-file-ext: ".txt"
-  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-3n-dnv"
+  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-3n-dnv-mrr"
   data: "table-last-failed-tests-3n-dnv"
   filter: "'MRR'"
   parameters:
   title: "Last failed tests (last builds) 2n-dnv"
   algorithm: "table_last_failed_tests"
   output-file-ext: ".txt"
-  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-2n-dnv"
+  output-file: "{DIR[STATIC,VPP]}/last-failed-tests-2n-dnv-mrr"
   data: "table-last-failed-tests-2n-dnv"
   filter: "'MRR'"
   parameters:
   input-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-1t1c-3n-hsw-ndr.csv"
   output-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-1t1c-3n-hsw-ndr.rst"
   testbed: "3n-hsw"
-  add-links: False
+  test-type: "NDR"
+  add-links: True
 
 -
   type: "table"
   input-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-1t1c-3n-hsw-pdr.csv"
   output-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-1t1c-3n-hsw-pdr.rst"
   testbed: "3n-hsw"
-  add-links: False
+  test-type: "PDR"
+  add-links: True
 
 # 3n-skx
 -
   input-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-3n-skx-ndr.csv"
   output-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-3n-skx-ndr.rst"
   testbed: "3n-skx"
-  add-links: False
+  test-type: "NDR"
+  add-links: True
 
 -
   type: "table"
   input-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-3n-skx-pdr.csv"
   output-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-3n-skx-pdr.rst"
   testbed: "3n-skx"
-  add-links: False
+  test-type: "PDR"
+  add-links: True
 
 # 2n-skx
 -
   input-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-2n-skx-ndr.csv"
   output-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-2n-skx-ndr.rst"
   testbed: "2n-skx"
-  add-links: False
+  test-type: "NDR"
+  add-links: True
 
 -
   type: "table"
   input-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-2n-skx-pdr.csv"
   output-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-2n-skx-pdr.rst"
   testbed: "2n-skx"
-  add-links: False
+  test-type: "PDR"
+  add-links: True
 
 # 2n-clx
 -
   input-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-2n-clx-ndr.csv"
   output-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-2n-clx-ndr.rst"
   testbed: "2n-clx"
-  add-links: False
+  test-type: "NDR"
+  add-links: True
 
 -
   type: "table"
   input-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-2n-clx-pdr.csv"
   output-file: "{DIR[STATIC,VPP]}/performance-trending-dashboard-2t1c-2n-clx-pdr.rst"
   testbed: "2n-clx"
-  add-links: False
+  test-type: "PDR"
+  add-links: True
 
 -
   type: "table"
   input-file: "{DIR[STATIC,VPP]}/failed-tests-3n-hsw-ndrpdr.csv"
   output-file: "{DIR[STATIC,VPP]}/failed-tests-3n-hsw-ndrpdr.rst"
   testbed: "3n-hsw"
+  test-type: "NDRPDR"
 
-################################################################################
+###############################################################################
 # 3n-skx
 -
   type: "table"
   input-file: "{DIR[STATIC,VPP]}/failed-tests-3n-skx-ndrpdr.csv"
   output-file: "{DIR[STATIC,VPP]}/failed-tests-3n-skx-ndrpdr.rst"
   testbed: "3n-skx"
+  test-type: "NDRPDR"
 
 ################################################################################
 # 2n-skx
   input-file: "{DIR[STATIC,VPP]}/failed-tests-2n-skx-ndrpdr.csv"
   output-file: "{DIR[STATIC,VPP]}/failed-tests-2n-skx-ndrpdr.rst"
   testbed: "2n-skx"
+  test-type: "NDRPDR"
 
 ################################################################################
 # 2n-clx
   input-file: "{DIR[STATIC,VPP]}/failed-tests-2n-clx-ndrpdr.csv"
   output-file: "{DIR[STATIC,VPP]}/failed-tests-2n-clx-ndrpdr.rst"
   testbed: "2n-clx"
+  test-type: "NDRPDR"
 
 ################################################################################
 # 3n-tsh