Skip to content

Commit be2b77d

Browse files
SrideviRameshgkeishin
authored andcommitted
Update CT Metrics
Changes: - Update the reference file - Remove unused arguments - Cleanup spaces - Add a description of arguments Tested: - Tested the script python3 tools/ct_metrics/gen_csv_results.py -s output.xml -d dummy --version_id abcd123 --platform bmc --level 123 Change-Id: I0ceadf49020397ec488a282228c6b43162f0146d Signed-off-by: Sridevi Ramesh <[email protected]>
1 parent b05a07a commit be2b77d

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

tools/ct_metrics/gen_csv_results.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
r"""
44
Use robot framework API to extract test result data from output.xml generated
55
by robot tests. For more information on the Robot Framework API, see
6-
http://robot-framework.readthedocs.io/en/3.0/autodoc/robot.result.html
6+
https://robot-framework.readthedocs.io/en/stable/autodoc/robot.result.html
77
"""
88

99
import csv
@@ -42,7 +42,7 @@
4242
"%(prog)s uses a robot framework API to extract test result data"
4343
" from output.xml generated by robot tests. For more information on"
4444
" the Robot Framework API, see "
45-
" http://robot-framework.readthedocs.io/en/3.0/autodoc/robot.result.html"
45+
" https://robot-framework.readthedocs.io/en/stable/autodoc/robot.result.html"
4646
),
4747
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
4848
prefix_chars="-+",
@@ -52,7 +52,7 @@
5252
"--source",
5353
"-s",
5454
help=(
55-
"The output.xml robot test result file path. This parameter is "
55+
"The output.xml robot test result file path. This parameter is "
5656
" required."
5757
),
5858
)
@@ -61,39 +61,39 @@
6161
"--dest",
6262
"-d",
6363
help=(
64-
"The directory path where the generated .csv files will go. This "
65-
" parameter is required."
64+
"The directory path where the generated .csv files will go. This"
65+
" parameter is required."
6666
),
6767
)
6868

6969
parser.add_argument(
7070
"--version_id",
7171
help=(
72-
"Driver version of openbmc firmware which was used during test, "
72+
"Driver version of openbmc firmware which was used during test,"
7373
' e.g. "v2.1-215-g6e7eacb". This parameter is required.'
7474
),
7575
)
7676

7777
parser.add_argument(
7878
"--platform",
7979
help=(
80-
"OpenBMC platform which was used during test, e.g."
80+
"OpenBMC platform which was used during test, e.g."
8181
' "Witherspoon". This parameter is required.'
8282
),
8383
)
8484

8585
parser.add_argument(
8686
"--level",
8787
help=(
88-
"OpenBMC release level which was used during test, e.g."
88+
"OpenBMC release level which was used during test, e.g."
8989
' "Master", "OBMC920". This parameter is required.'
9090
),
9191
)
9292

9393
parser.add_argument(
9494
"--test_phase",
9595
help=(
96-
'Name of testing phase, e.g. "DVT", "SVT", etc. This'
96+
'Name of testing phase, e.g. "CI", "Regression", etc. This'
9797
" parameter is optional."
9898
),
9999
default="FVT",
@@ -102,15 +102,15 @@
102102
parser.add_argument(
103103
"--subsystem",
104104
help=(
105-
'Name of the subsystem, e.g. "OPENBMC" etc. This parameter is'
105+
'Name of the subsystem, e.g. "OPENBMC" etc. This parameter is'
106106
" optional."
107107
),
108108
default="OPENBMC",
109109
)
110110

111111
parser.add_argument(
112112
"--processor",
113-
help='Name of processor, e.g. "P9". This parameter is optional.',
113+
help='Name of processor, e.g. "XY". This parameter is optional.',
114114
default="OPENPOWER",
115115
)
116116

@@ -119,7 +119,7 @@
119119
stock_list = [("test_mode", 0), ("quiet", 0), ("debug", 0)]
120120

121121

122-
def exit_function(signal_number=0, frame=None):
122+
def exit_function(signal_number=0):
123123
r"""
124124
Execute whenever the program ends normally or with the signals that we
125125
catch (i.e. TERM, INT).
@@ -132,7 +132,7 @@ def exit_function(signal_number=0, frame=None):
132132
qprint_pgm_footer()
133133

134134

135-
def signal_handler(signal_number, frame):
135+
def signal_handler():
136136
r"""
137137
Handle signals. Without a function to catch a SIGTERM or SIGINT, the
138138
program would terminate immediately with return code 143 and without
@@ -191,6 +191,9 @@ def parse_output_xml(
191191
platform Platform of the openbmc system.
192192
level Release level of the OpenBMC system
193193
(e.g. "Master").
194+
test_phase Name of the test phase
195+
e.g. "CI", "Regression", etc.
196+
processor Name of processor, e.g. "XY".
194197
"""
195198

196199
# Initialize tallies
@@ -384,7 +387,7 @@ def xml_to_csv_time(xml_datetime):
384387
and return it.
385388
386389
Description of argument(s):
387-
datetime The date in the following format: %Y%m%d
390+
xml_datetime The date in the following format: %Y%m%d
388391
%H:%M:%S.%f (This is the format
389392
typically found in an XML file.)
390393

0 commit comments

Comments
 (0)