aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/generator_alerts.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2019-10-02 14:03:57 +0200
committerTibor Frank <tifrank@cisco.com>2019-10-03 13:37:16 +0200
commit30c5d0cb071650a26357ef6e2737f17422ad824d (patch)
treee52f951dff484b010794926783695e676bf3053b /resources/tools/presentation/generator_alerts.py
parent43e969af97832930a122aca538ef271e714838b5 (diff)
Trending: Report also nr of passed tests in email
Change-Id: I7ae188f5f684bd93352255d6b5c491b6d78c822c Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/generator_alerts.py')
-rw-r--r--resources/tools/presentation/generator_alerts.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/resources/tools/presentation/generator_alerts.py b/resources/tools/presentation/generator_alerts.py
index 1b40dbbbf9..ed4318b3a6 100644
--- a/resources/tools/presentation/generator_alerts.py
+++ b/resources/tools/presentation/generator_alerts.py
@@ -237,9 +237,9 @@ class Alerting(object):
:type alert: dict
:type test_set: str
:type sort: bool
- :returns: CSIT build number, VPP version, Number of failed tests,
- Compressed failed tests.
- :rtype: tuple(str, str, int, OrderedDict)
+ :returns: CSIT build number, VPP version, Number of passed tests,
+ Number of failed tests, Compressed failed tests.
+ :rtype: tuple(str, str, int, int, OrderedDict)
"""
directory = self.configs[alert["way"]]["output-dir"]
@@ -255,6 +255,12 @@ class Alerting(object):
if idx == 1:
version = line[:-1]
continue
+ if idx == 2:
+ passed = line[:-1]
+ continue
+ if idx == 3:
+ failed = line[:-1]
+ continue
try:
test = line[:-1].split('-')
nic = test[0]
@@ -283,9 +289,9 @@ class Alerting(object):
keys.sort()
for key in keys:
sorted_failed_tests[key] = failed_tests[key]
- return build, version, idx-1, sorted_failed_tests
+ return build, version, passed, failed, sorted_failed_tests
else:
- return build, version, idx-1, failed_tests
+ return build, version, passed, failed, failed_tests
def _generate_email_body(self, alert):
"""Create the file which is used in the generated alert.
@@ -302,7 +308,7 @@ class Alerting(object):
text = ""
for idx, test_set in enumerate(alert.get("include", [])):
- build, version, nr, failed_tests = \
+ build, version, passed, failed, failed_tests = \
self._get_compressed_failed_tests(alert, test_set)
if build is None:
ret_code, build_nr, _ = get_last_completed_build_number(
@@ -317,12 +323,14 @@ class Alerting(object):
build=build_nr)
continue
text += ("\n\n{topo}-{arch}, "
- "{nr} tests failed, "
+ "{failed} tests failed, "
+ "{passed} tests passed, "
"CSIT build: {link}/{build}, "
"VPP version: {version}\n\n".
format(topo=test_set.split('-')[-2],
arch=test_set.split('-')[-1],
- nr=nr,
+ failed=failed,
+ passed=passed,
link=alert["urls"][idx],
build=build,
version=version))