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

Side by Side Diff: build/android/test_runner.py

Issue 1971433002: ABANDONED [Android] Expose each try result in test results JSON. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Runs all types of tests from one unified interface.""" 7 """Runs all types of tests from one unified interface."""
8 8
9 import argparse 9 import argparse
10 import collections 10 import collections
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 with test_instance_factory.CreateTestInstance(args, infra_error) as test: 849 with test_instance_factory.CreateTestInstance(args, infra_error) as test:
850 with test_run_factory.CreateTestRun( 850 with test_run_factory.CreateTestRun(
851 args, env, test, infra_error) as test_run: 851 args, env, test, infra_error) as test_run:
852 results = [] 852 results = []
853 repetitions = (xrange(args.repeat + 1) if args.repeat >= 0 853 repetitions = (xrange(args.repeat + 1) if args.repeat >= 0
854 else itertools.count()) 854 else itertools.count())
855 result_counts = collections.defaultdict( 855 result_counts = collections.defaultdict(
856 lambda: collections.defaultdict(int)) 856 lambda: collections.defaultdict(int))
857 iteration_count = 0 857 iteration_count = 0
858 for _ in repetitions: 858 for _ in repetitions:
859 iteration_results = test_run.RunTests() 859 raw_results = test_run.RunTests()
860 if iteration_results is not None: 860 if not raw_results:
861 iteration_count += 1 861 continue
862 results.append(iteration_results) 862
863 for r in iteration_results.GetAll(): 863 results.extend(raw_results)
mikecase (-- gone --) 2016/05/13 17:45:34 My only question I guess would be will the Generat
jbudorick 2016/05/13 17:59:10 It should: https://code.google.com/p/chromium/code
864 result_counts[r.GetName()][r.GetType()] += 1 864
865 report_results.LogFull( 865 iteration_results = base_test_result.TestRunResults()
866 results=iteration_results, 866 for r in raw_results:
867 test_type=test.TestType(), 867 iteration_results.AddTestRunResults(r)
mikecase (-- gone --) 2016/05/13 17:32:13 I find this pretty confusing. So, just to make sur
jbudorick 2016/05/13 17:37:05 No, raw_results is a list of base_test_result.Test
868 test_package=test_run.TestPackage(), 868
869 annotation=getattr(args, 'annotations', None), 869 iteration_count += 1
870 flakiness_server=getattr(args, 'flakiness_dashboard_server', 870 for r in iteration_results.GetAll():
871 None)) 871 result_counts[r.GetName()][r.GetType()] += 1
872 if args.break_on_failure and not iteration_results.DidRunPass(): 872 report_results.LogFull(
873 break 873 results=iteration_results,
874 test_type=test.TestType(),
875 test_package=test_run.TestPackage(),
876 annotation=getattr(args, 'annotations', None),
877 flakiness_server=getattr(args, 'flakiness_dashboard_server',
878 None))
879 if args.break_on_failure and not iteration_results.DidRunPass():
880 break
874 881
875 if iteration_count > 1: 882 if iteration_count > 1:
876 # display summary results 883 # display summary results
877 # only display results for a test if at least one test did not pass 884 # only display results for a test if at least one test did not pass
878 all_pass = 0 885 all_pass = 0
879 tot_tests = 0 886 tot_tests = 0
880 for test_name in result_counts: 887 for test_name in result_counts:
881 tot_tests += 1 888 tot_tests += 1
882 if any(result_counts[test_name][x] for x in ( 889 if any(result_counts[test_name][x] for x in (
883 base_test_result.ResultType.FAIL, 890 base_test_result.ResultType.FAIL,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 if e.is_infra_error: 970 if e.is_infra_error:
964 return constants.INFRA_EXIT_CODE 971 return constants.INFRA_EXIT_CODE
965 return constants.ERROR_EXIT_CODE 972 return constants.ERROR_EXIT_CODE
966 except: # pylint: disable=W0702 973 except: # pylint: disable=W0702
967 logging.exception('Unrecognized error occurred.') 974 logging.exception('Unrecognized error occurred.')
968 return constants.ERROR_EXIT_CODE 975 return constants.ERROR_EXIT_CODE
969 976
970 977
971 if __name__ == '__main__': 978 if __name__ == '__main__':
972 sys.exit(main()) 979 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698