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

Side by Side Diff: build/android/pylib/local/device/local_device_instrumentation_test_run.py

Issue 1570043004: Adds --skip-clear-data flag to android's test_runner.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update todo Created 4 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
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 logging 5 import logging
6 import re 6 import re
7 import time 7 import time
8 8
9 from devil.android import device_errors 9 from devil.android import device_errors
10 from pylib import flag_changer 10 from pylib import flag_changer
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 result_code, result_bundle, statuses, start_ms, duration_ms) 212 result_code, result_bundle, statuses, start_ms, duration_ms)
213 if flags: 213 if flags:
214 for r in results: 214 for r in results:
215 if r.GetName() == test_name: 215 if r.GetName() == test_name:
216 r.SetName(test_display_name) 216 r.SetName(test_display_name)
217 if DidPackageCrashOnDevice(self._test_instance.test_package, device): 217 if DidPackageCrashOnDevice(self._test_instance.test_package, device):
218 for r in results: 218 for r in results:
219 if r.GetType() == base_test_result.ResultType.UNKNOWN: 219 if r.GetType() == base_test_result.ResultType.UNKNOWN:
220 r.SetType(base_test_result.ResultType.CRASH) 220 r.SetType(base_test_result.ResultType.CRASH)
221 # TODO(jbudorick): ClearApplicationState on failure before switching 221 # TODO(jbudorick): ClearApplicationState on failure before switching
222 # instrumentation tests to platform mode. 222 # instrumentation tests to platform mode (but respect --skip-clear-data).
223 return results 223 return results
224 224
225 #override 225 #override
226 def _ShouldShard(self): 226 def _ShouldShard(self):
227 return True 227 return True
228 228
229 @classmethod 229 @classmethod
230 def _GetTimeoutScaleFromAnnotations(cls, annotations): 230 def _GetTimeoutScaleFromAnnotations(cls, annotations):
231 try: 231 try:
232 return int(annotations.get('TimeoutScale', 1)) 232 return int(annotations.get('TimeoutScale', 1))
233 except ValueError as e: 233 except ValueError as e:
234 logging.warning("Non-integer value of TimeoutScale ignored. (%s)", str(e)) 234 logging.warning("Non-integer value of TimeoutScale ignored. (%s)", str(e))
235 return 1 235 return 1
236 236
237 @classmethod 237 @classmethod
238 def _GetTimeoutFromAnnotations(cls, annotations, test_name): 238 def _GetTimeoutFromAnnotations(cls, annotations, test_name):
239 for k, v in TIMEOUT_ANNOTATIONS: 239 for k, v in TIMEOUT_ANNOTATIONS:
240 if k in annotations: 240 if k in annotations:
241 timeout = v 241 timeout = v
242 break 242 break
243 else: 243 else:
244 logging.warning('Using default 1 minute timeout for %s', test_name) 244 logging.warning('Using default 1 minute timeout for %s', test_name)
245 timeout = 60 245 timeout = 60
246 246
247 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations) 247 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations)
248 248
249 return timeout 249 return timeout
250 250
OLDNEW
« no previous file with comments | « build/android/pylib/local/device/local_device_gtest_run.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698