aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2020-05-18 08:16:52 +0200
committerTibor Frank <tifrank@cisco.com>2020-05-19 04:50:54 +0000
commitdd36153562829ad84022cf5aa7746862c8f09156 (patch)
tree55a76926b9b50eb0faa7e738b8942d13e27b3d6b /resources/tools
parentde08ebfec25d2d9bb3f3b46c07a5bcb9efd24d1c (diff)
Trending: CSIT-1717: Add links from dashboard to graphs
+ fix TB names in alerts Change-Id: Ia10e9b82b57e90f7ae4592bd6ecf8b71dea71cc8 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools')
-rw-r--r--resources/tools/presentation/generator_alerts.py29
-rw-r--r--resources/tools/presentation/generator_tables.py76
-rw-r--r--resources/tools/presentation/specification_CPTA.yaml58
3 files changed, 121 insertions, 42 deletions
diff --git a/resources/tools/presentation/generator_alerts.py b/resources/tools/presentation/generator_alerts.py
index b0606b6fd7..8e4f31e4cf 100644
--- a/resources/tools/presentation/generator_alerts.py
+++ b/resources/tools/presentation/generator_alerts.py
@@ -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"
)
diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py
index 2644eb0348..b0481053eb 100644
--- a/resources/tools/presentation/generator_tables.py
+++ b/resources/tools/presentation/generator_tables.py
@@ -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
diff --git a/resources/tools/presentation/specification_CPTA.yaml b/resources/tools/presentation/specification_CPTA.yaml
index d28bcb73a9..fa41ab45f0 100644
--- a/resources/tools/presentation/specification_CPTA.yaml
+++ b/resources/tools/presentation/specification_CPTA.yaml
@@ -126,13 +126,13 @@
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"
@@ -765,7 +765,7 @@
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:
@@ -778,7 +778,7 @@
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:
@@ -791,7 +791,7 @@
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:
@@ -804,7 +804,7 @@
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:
@@ -817,7 +817,7 @@
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:
@@ -830,7 +830,7 @@
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:
@@ -843,7 +843,7 @@
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:
@@ -1013,7 +1013,8 @@
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"
@@ -1022,7 +1023,8 @@
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
-
@@ -1064,7 +1066,8 @@
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"
@@ -1073,7 +1076,8 @@
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
-
@@ -1115,7 +1119,8 @@
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"
@@ -1124,7 +1129,8 @@
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
-
@@ -1166,7 +1172,8 @@
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"
@@ -1175,7 +1182,8 @@
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"
@@ -1220,8 +1228,9 @@
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"
@@ -1335,6 +1344,7 @@
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
@@ -1450,6 +1460,7 @@
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
@@ -1565,6 +1576,7 @@
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