Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Side by Side Diff: client/tests/kvm/scan_results.py

Issue 6246035: Merge remote branch 'cros/upstream' into master (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 """ 2 """
3 Program that parses the autotest results and return a nicely printed final test 3 Program that parses the autotest results and return a nicely printed final test
4 result. 4 result.
5 5
6 @copyright: Red Hat 2008-2009 6 @copyright: Red Hat 2008-2009
7 """ 7 """
8 8
9 def parse_results(text): 9 def parse_results(text):
10 """ 10 """
(...skipping 20 matching lines...) Expand all
31 # Found an END line -- get end time, name and status 31 # Found an END line -- get end time, name and status
32 elif (line.startswith("END") and len(parts) >= 5 and 32 elif (line.startswith("END") and len(parts) >= 5 and
33 parts[3].startswith("timestamp")): 33 parts[3].startswith("timestamp")):
34 end_time = float(parts[3].split("=")[1]) 34 end_time = float(parts[3].split("=")[1])
35 start_time = start_time_list.pop() 35 start_time = start_time_list.pop()
36 info = info_list.pop() 36 info = info_list.pop()
37 test_name = parts[2] 37 test_name = parts[2]
38 test_status = parts[0].split()[1] 38 test_status = parts[0].split()[1]
39 # Remove "kvm." prefix 39 # Remove "kvm." prefix
40 if test_name.startswith("kvm."): 40 if test_name.startswith("kvm."):
41 test_name = test_name.split("kvm.")[1] 41 test_name = test_name[4:]
42 result_list.append((test_name, test_status, 42 result_list.append((test_name, test_status,
43 int(end_time - start_time), info)) 43 int(end_time - start_time), info))
44 44
45 # Found a FAIL/ERROR/GOOD line -- get failure/success info 45 # Found a FAIL/ERROR/GOOD line -- get failure/success info
46 elif (len(parts) >= 6 and parts[3].startswith("timestamp") and 46 elif (len(parts) >= 6 and parts[3].startswith("timestamp") and
47 parts[4].startswith("localtime")): 47 parts[4].startswith("localtime")):
48 info_list[-1] = parts[5] 48 info_list[-1] = parts[5]
49 49
50 return result_list 50 return result_list
51 51
(...skipping 27 matching lines...) Expand all
79 print_result(("Test", "Status", "Seconds", "Info"), name_width) 79 print_result(("Test", "Status", "Seconds", "Info"), name_width)
80 print_result(("----", "------", "-------", "----"), name_width) 80 print_result(("----", "------", "-------", "----"), name_width)
81 81
82 for resfile, results in result_lists: 82 for resfile, results in result_lists:
83 print " (Result file: %s)" % resfile 83 print " (Result file: %s)" % resfile
84 for r in results: 84 for r in results:
85 print_result(r, name_width) 85 print_result(r, name_width)
86 86
87 87
88 if __name__ == "__main__": 88 if __name__ == "__main__":
89 import sys, os, glob 89 import sys, glob
90 90
91 resfiles = glob.glob("../../results/default/status*") 91 resfiles = glob.glob("../../results/default/status*")
92 if len(sys.argv) > 1: 92 if len(sys.argv) > 1:
93 if sys.argv[1] == "-h" or sys.argv[1] == "--help": 93 if sys.argv[1] == "-h" or sys.argv[1] == "--help":
94 print "Usage: %s [result files]" % sys.argv[0] 94 print "Usage: %s [result files]" % sys.argv[0]
95 sys.exit(0) 95 sys.exit(0)
96 resfiles = sys.argv[1:] 96 resfiles = sys.argv[1:]
97 main(resfiles) 97 main(resfiles)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698