aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/generator_alerts.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2021-07-13 08:47:31 +0200
committerTibor Frank <tifrank@cisco.com>2021-07-22 09:01:25 +0000
commit81e2c5626e09805682b4d94e4ef4ae099c6633ed (patch)
tree572d7069764e942edee7060846efdfdb2cb61bc6 /resources/tools/presentation/generator_alerts.py
parent47c92dcb71a6c342dec32fbdc39f543fd857d5b5 (diff)
Trending: Add graph with statistics
- x-axis: time [MM-DD] - y-axis: nr of passed/failed tests - y-axis: build duration Change-Id: I269af5a728a32d02ffcdecc7e25138ad1a183c4b Signed-off-by: Tibor Frank <tifrank@cisco.com> (cherry picked from commit d8fc1521b8def68adc8f4a390aa2d25db806ea4f)
Diffstat (limited to 'resources/tools/presentation/generator_alerts.py')
-rw-r--r--resources/tools/presentation/generator_alerts.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/resources/tools/presentation/generator_alerts.py b/resources/tools/presentation/generator_alerts.py
index a71b775485..4dd78fe820 100644
--- a/resources/tools/presentation/generator_alerts.py
+++ b/resources/tools/presentation/generator_alerts.py
@@ -246,7 +246,7 @@ class Alerting:
:type sort: bool
:returns: CSIT build number, VPP version, Number of passed tests,
Number of failed tests, Compressed failed tests.
- :rtype: tuple(str, str, int, int, OrderedDict)
+ :rtype: tuple(str, str, int, int, str, OrderedDict)
"""
directory = self.configs[alert[u"way"]][u"output-dir"]
@@ -268,6 +268,10 @@ class Alerting:
if idx == 3:
failed = line[:-1]
continue
+ if idx == 4:
+ minutes = int(line[:-1]) // 60000
+ duration = f"{(minutes // 60):02d}:{(minutes % 60):02d}"
+ continue
try:
test = line[:-1].split(u'-')
name = u'-'.join(test[3:-1])
@@ -285,14 +289,14 @@ class Alerting:
failed_tests[name][u"cores"].append(test[2])
except IOError:
logging.error(f"No such file or directory: {file_path}")
- return None, None, None, None, None
+ return None, None, None, None, None, None
if sort:
sorted_failed_tests = OrderedDict()
for key in sorted(failed_tests.keys()):
sorted_failed_tests[key] = failed_tests[key]
- return build, version, passed, failed, sorted_failed_tests
+ return build, version, passed, failed, duration, sorted_failed_tests
- return build, version, passed, failed, failed_tests
+ return build, version, passed, failed, duration, failed_tests
def _list_gressions(self, alert, idx, header, re_pro):
"""Create a file with regressions or progressions for the test set
@@ -352,7 +356,7 @@ class Alerting:
try:
groups = re.search(
re.compile(
- r'((vpp|dpdk)-\dn-(skx|clx|hsw|tsh|dnv|zn2|tx2)-.*)'
+ r'((vpp|dpdk)-\dn-(skx|clx|tsh|dnv|zn2|tx2)-.*)'
),
test_set
)
@@ -363,7 +367,7 @@ class Alerting:
f"The test set {test_set} does not include information "
f"about test bed. Using empty string instead."
)
- build, version, passed, failed, failed_tests = \
+ build, version, passed, failed, duration, failed_tests = \
self._get_compressed_failed_tests(alert, test_set)
if build is None:
text += (
@@ -373,8 +377,11 @@ class Alerting:
)
continue
text += (
- f"\n\n{test_set_short}, {failed} tests failed, {passed} tests "
- f"passed, CSIT build: {alert[u'urls'][idx]}/{build}, "
+ f"\n\n{test_set_short}, "
+ f"{failed} tests failed, "
+ f"{passed} tests passed, "
+ f"duration: {duration}, "
+ f"CSIT build: {alert[u'urls'][idx]}/{build}, "
f"{device} version: {version}\n\n"
)