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

Side by Side Diff: build/android/pylib/instrumentation/instrumentation_test_instance.py

Issue 2786773002: (Reland) Add failure screenshots and images to results detail. (Closed)
Patch Set: (Reland) Add failure screenshots and images to results detail. Created 3 years, 8 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 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import collections 5 import collections
6 import copy 6 import copy
7 import json 7 import json
8 import logging 8 import logging
9 import os 9 import os
10 import pickle 10 import pickle
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 491
492 self._timeout_scale = None 492 self._timeout_scale = None
493 self._initializeTestControlAttributes(args) 493 self._initializeTestControlAttributes(args)
494 494
495 self._coverage_directory = None 495 self._coverage_directory = None
496 self._initializeTestCoverageAttributes(args) 496 self._initializeTestCoverageAttributes(args)
497 497
498 self._store_tombstones = False 498 self._store_tombstones = False
499 self._initializeTombstonesAttributes(args) 499 self._initializeTombstonesAttributes(args)
500 500
501 self._gs_results_bucket = None
502 self._should_save_images = None
501 self._should_save_logcat = None 503 self._should_save_logcat = None
502 self._initializeLogAttributes(args) 504 self._initializeLogAttributes(args)
503 505
504 self._edit_shared_prefs = [] 506 self._edit_shared_prefs = []
505 self._initializeEditPrefsAttributes(args) 507 self._initializeEditPrefsAttributes(args)
506 508
507 self._external_shard_index = args.test_launcher_shard_index 509 self._external_shard_index = args.test_launcher_shard_index
508 self._total_external_shards = args.test_launcher_total_shards 510 self._total_external_shards = args.test_launcher_total_shards
509 511
510 def _initializeApkAttributes(self, args, error_func): 512 def _initializeApkAttributes(self, args, error_func):
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 self._screenshot_dir = args.screenshot_dir 677 self._screenshot_dir = args.screenshot_dir
676 self._timeout_scale = args.timeout_scale or 1 678 self._timeout_scale = args.timeout_scale or 1
677 679
678 def _initializeTestCoverageAttributes(self, args): 680 def _initializeTestCoverageAttributes(self, args):
679 self._coverage_directory = args.coverage_dir 681 self._coverage_directory = args.coverage_dir
680 682
681 def _initializeTombstonesAttributes(self, args): 683 def _initializeTombstonesAttributes(self, args):
682 self._store_tombstones = args.store_tombstones 684 self._store_tombstones = args.store_tombstones
683 685
684 def _initializeLogAttributes(self, args): 686 def _initializeLogAttributes(self, args):
687 # Will archive test images if we are given a GS bucket to store the results
688 # in and are given a results file to output the links to.
689 self._gs_results_bucket = args.gs_results_bucket
690 self._should_save_images = (
jbudorick 2017/04/29 01:12:25 nit: do we need to save this separately?
mikecase (-- gone --) 2017/05/03 21:25:14 I guess I can just check for _gs_results_bucket. S
691 bool(args.json_results_file) and bool(args.gs_results_bucket))
685 self._should_save_logcat = bool(args.json_results_file) 692 self._should_save_logcat = bool(args.json_results_file)
686 693
687 def _initializeEditPrefsAttributes(self, args): 694 def _initializeEditPrefsAttributes(self, args):
688 if not hasattr(args, 'shared_prefs_file') or not args.shared_prefs_file: 695 if not hasattr(args, 'shared_prefs_file') or not args.shared_prefs_file:
689 return 696 return
690 if not isinstance(args.shared_prefs_file, str): 697 if not isinstance(args.shared_prefs_file, str):
691 logging.warning("Given non-string for a filepath") 698 logging.warning("Given non-string for a filepath")
692 return 699 return
693 700
694 # json.load() loads strings as unicode, which causes issues when trying 701 # json.load() loads strings as unicode, which causes issues when trying
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 747
741 @property 748 @property
742 def external_shard_index(self): 749 def external_shard_index(self):
743 return self._external_shard_index 750 return self._external_shard_index
744 751
745 @property 752 @property
746 def flags(self): 753 def flags(self):
747 return self._flags 754 return self._flags
748 755
749 @property 756 @property
757 def gs_results_bucket(self):
758 return self._gs_results_bucket
759
760 @property
761 def should_save_images(self):
762 return self._should_save_images
763
764 @property
750 def should_save_logcat(self): 765 def should_save_logcat(self):
751 return self._should_save_logcat 766 return self._should_save_logcat
752 767
753 @property 768 @property
754 def package_info(self): 769 def package_info(self):
755 return self._package_info 770 return self._package_info
756 771
757 @property 772 @property
758 def screenshot_dir(self): 773 def screenshot_dir(self):
759 return self._screenshot_dir 774 return self._screenshot_dir
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 897
883 @staticmethod 898 @staticmethod
884 def GenerateTestResults( 899 def GenerateTestResults(
885 result_code, result_bundle, statuses, start_ms, duration_ms): 900 result_code, result_bundle, statuses, start_ms, duration_ms):
886 return GenerateTestResults(result_code, result_bundle, statuses, 901 return GenerateTestResults(result_code, result_bundle, statuses,
887 start_ms, duration_ms) 902 start_ms, duration_ms)
888 903
889 #override 904 #override
890 def TearDown(self): 905 def TearDown(self):
891 pass 906 pass
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698