aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2017-01-13 13:33:03 +0100
committerPeter Mikus <pmikus@cisco.com>2017-01-17 19:19:47 +0000
commit6a00ab3009930ba06bb2b28118398d8f232be4b9 (patch)
tree5f08d7caaa6445ae3efbc99fa25f4de55e3cdd5e /resources
parent032f90ff6bb8f37c429097fdf497d892988ff3be (diff)
Update: robot parser scripts
Update robot parser script due to new naming and TAG structure Change-Id: I963de747d2c88dadcb2d3fa48747fb2ef1403294 Signed-off-by: pmikus <pmikus@cisco.com>
Diffstat (limited to 'resources')
-rwxr-xr-xresources/tools/robot_output_parser.py30
-rwxr-xr-xresources/tools/robot_output_parser_publish.py8
2 files changed, 25 insertions, 13 deletions
diff --git a/resources/tools/robot_output_parser.py b/resources/tools/robot_output_parser.py
index dc6554246b..171a66fab3 100755
--- a/resources/tools/robot_output_parser.py
+++ b/resources/tools/robot_output_parser.py
@@ -27,13 +27,15 @@ from robot.api import ExecutionResult, ResultVisitor
class ExecutionChecker(ResultVisitor):
"""Iterates through test cases."""
- tc_regexp = re.compile(ur'^TC\d+:\s((\d+)B|IMIX_v4_1)[\D\d]+\s(\d)'\
- '(thread|threads)\\s(\\d)(core|cores)\\s(\\d)(rxq|rxqs)')
+ tc_regexp = re.compile(ur'^tc\d+-((\d+)B|IMIX)-(\d)t(\d)c-(.*)')
rate_regexp = re.compile(ur'^[\D\d]*FINAL_RATE:\s(\d+\.\d+)[\D\d]*')
lat_regexp = re.compile(ur'^[\D\d]*'\
- 'LAT_\\d+%NDR:\\s\\[\'(\\d+\\/\\d+\\/\\d+)\',\\s\'(\\d+\\/\\d+\\/\\d+)\'\\]\\s\n'\
- 'LAT_\\d+%NDR:\\s\\[\'(\\d+\\/\\d+\\/\\d+)\',\\s\'(\\d+\\/\\d+\\/\\d+)\'\\]\\s\n'\
- 'LAT_\\d+%NDR:\\s\\[\'(\\d+\\/\\d+\\/\\d+)\',\\s\'(\\d+\\/\\d+\\/\\d+)\'\\]')
+ ur'LAT_\d+%NDR:\s\[\'(-?\d+\/-?\d+\/-?\d+)\','\
+ ur'\s\'(-?\d+\/-?\d+\/-?\d+)\'\]\s\n'\
+ ur'LAT_\d+%NDR:\s\[\'(-?\d+\/-?\d+\/-?\d+)\','\
+ ur'\s\'(-?\d+\/-?\d+\/-?\d+)\'\]\s\n'\
+ ur'LAT_\d+%NDR:\s\[\'(-?\d+\/-?\d+\/-?\d+)\','\
+ ur'\s\'(-?\d+\/-?\d+\/-?\d+)\'\]')
def __init__(self, args):
self.root = ET.Element('build',
@@ -95,11 +97,21 @@ class ExecutionChecker(ResultVisitor):
"S"+test.parent.name.replace(" ", ""))
test_elem.attrib['name'] = test.parent.name
test_elem.attrib['framesize'] = str(re.search(\
- self.tc_regexp, test.name).group(2))
- test_elem.attrib['workerthreads'] = str(re.search(\
+ self.tc_regexp, test.name).group(1))
+ test_elem.attrib['threads'] = str(re.search(\
self.tc_regexp, test.name).group(3))
- test_elem.attrib['workerspernic'] = str(re.search(\
- self.tc_regexp, test.name).group(7))
+ test_elem.attrib['cores'] = str(re.search(\
+ self.tc_regexp, test.name).group(4))
+ if any("NDRDISC" in tag for tag in test.tags):
+ test_elem.attrib['lat_100'] = str(re.search(\
+ self.lat_regexp, test.message).group(1)) + '/' +\
+ str(re.search(self.lat_regexp, test.message).group(2))
+ test_elem.attrib['lat_50'] = str(re.search(\
+ self.lat_regexp, test.message).group(3)) + '/' +\
+ str(re.search(self.lat_regexp, test.message).group(4))
+ test_elem.attrib['lat_10'] = str(re.search(\
+ self.lat_regexp, test.message).group(5)) + '/' +\
+ str(re.search(self.lat_regexp, test.message).group(6))
test_elem.attrib['tags'] = ', '.join(tags)
test_elem.text = str(re.search(\
self.rate_regexp, test.message).group(1))
diff --git a/resources/tools/robot_output_parser_publish.py b/resources/tools/robot_output_parser_publish.py
index c3390cbe1e..caa5bd5d2b 100755
--- a/resources/tools/robot_output_parser_publish.py
+++ b/resources/tools/robot_output_parser_publish.py
@@ -44,13 +44,13 @@ class ExecutionChecker(ResultVisitor):
sys.stdout.write('<table width=100% border=1><tr>'+'\n')
sys.stdout.write('<th width=32%>Name</th>'+'\n')
sys.stdout.write('<th width=40%>Documentation</th>'+'\n')
- if "Perf" and "Long" in suite.longname:
+ if "ndrdisc" in suite.longname:
sys.stdout.write('<th width=24%>Message</th>'+'\n')
sys.stdout.write('<th width=4%>Status</th><tr/>'+'\n')
sys.stdout.write('</tr>')
elif self.formatting == 'wiki':
sys.stdout.write('{| class="wikitable"'+'\n')
- if "Perf" and "Long" in suite.longname:
+ if "ndrdisc" in suite.longname:
header = '!Name!!Documentation!!Message!!Status'
else:
header = '!Name!!Documentation!!Status'
@@ -130,7 +130,7 @@ class ExecutionChecker(ResultVisitor):
sys.stdout.write('<tr>'+'\n')
sys.stdout.write('<td>'+test.name+'</td>'+'\n')
sys.stdout.write('<td>'+test.doc+'</td>'+'\n')
- if any("PERFTEST_LONG" in tag for tag in test.tags):
+ if any("NDRPDRDISC" in tag for tag in test.tags):
sys.stdout.write('<td>'+test.message+'</td>'+'\n')
sys.stdout.write('<td>'+test.status+'</td>'+'\n')
elif self.formatting == 'wiki':
@@ -138,7 +138,7 @@ class ExecutionChecker(ResultVisitor):
sys.stdout.write('|'+test.name+'\n')
sys.stdout.write('|'+test.doc.replace('\n', ' ').replace('\r',\
'')+'\n')
- if any("PERFTEST_LONG" in tag for tag in test.tags):
+ if any("NDRPDRDISC" in tag for tag in test.tags):
sys.stdout.write('|'+test.message+'\n')
sys.stdout.write('|'+test.status+'\n')
else: