1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
#!/usr/bin/env python
# Actions available
# download
# --force (to remove existing dirs)
# --joblist (mandatory)
# combine
# --force (to remove existing result)
# summary
# --abi (to choose abi to report)
# focused
# --abi (to choos abi to report)
# purge
from argparse import ArgumentParser
from tools import (
download_results,
combine_results,
cts_summary,
focused_summary,
purge_results,
produce_html,
FINAL_RESULTS)
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument("-q",
"--quiet",
action="store_false",
dest="verbose",
default=True,
help="don't print status messages to stdout")
parser.add_argument("-o",
"--output",
dest="output",
default="results",
help="name of directory to store results (relative to PWD)")
parser.add_argument("-f",
"--force",
dest="force",
action="store_true",
default=False,
help="Overwrite existing files")
subparsers = parser.add_subparsers(
help='sub-command help')
parser_d = subparsers.add_parser("download",
help="Download CTS job results from LAVA")
parser_d.add_argument("-j",
"--job-list",
dest="joblist",
nargs="+",
required=True,
help="List of LAVA job IDs to download CTS results from")
parser_d.add_argument("-l",
"--lava-server",
dest="server",
default="https://validation.linaro.org/RPC2/",
help="LAVA server URL in form http://lava.server.address/RPC2/")
parser_d.set_defaults(func=download_results)
parser_c = subparsers.add_parser("combine",
help="Combine existing CTS results")
parser_c.set_defaults(func=combine_results)
parser_s = subparsers.add_parser("summary",
help="Print summary of CTS results")
parser_s.add_argument("-a",
"--abi",
dest="abi",
required=True,
help="Select only the ABI for displaing the results")
parser_s.add_argument("-f", "--file",
dest="sourcefile",
default=FINAL_RESULTS,
help="Source XML file")
parser_s.add_argument("-c",
"--csv", dest="savecsv",
action="store_true",
default=False,
help="Save CSV file with results")
parser_s.set_defaults(func=cts_summary)
parser_f = subparsers.add_parser("focused",
help="Print summary of focused CTS results")
parser_f.add_argument("-a",
"--abi",
dest="abi",
required=True,
help="Select only the ABI for displaing the results")
parser_f.add_argument("-f", "--file",
dest="sourcefile",
default=FINAL_RESULTS,
help="Source XML file")
parser_f.add_argument("-c",
"--csv", dest="savecsv",
action="store_true",
default=False,
help="Save CSV file with results")
parser_f.set_defaults(func=focused_summary)
parser_p = subparsers.add_parser("purge",
help="Remove all downloaded and generated files")
parser_p.set_defaults(func=purge_results)
parser_h = subparsers.add_parser("html",
help="Produce modified HTML report from CTS results")
parser_h.set_defaults(func=produce_html)
args = parser.parse_args()
args.func(args)
|