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

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

Issue 407173002: Added an annotation to label Integration tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test Runner changes for Integration tests. Created 6 years, 4 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
« no previous file with comments | « build/android/pylib/instrumentation/test_options.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Class for running instrumentation tests on a single device.""" 5 """Class for running instrumentation tests on a single device."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 self.device.RunShellCommand('stop') 156 self.device.RunShellCommand('stop')
157 self.device.RunShellCommand('start') 157 self.device.RunShellCommand('start')
158 158
159 # We give different default value to launch HTTP server based on shard index 159 # We give different default value to launch HTTP server based on shard index
160 # because it may have race condition when multiple processes are trying to 160 # because it may have race condition when multiple processes are trying to
161 # launch lighttpd with same port at same time. 161 # launch lighttpd with same port at same time.
162 self.LaunchTestHttpServer( 162 self.LaunchTestHttpServer(
163 os.path.join(constants.DIR_SOURCE_ROOT), self._lighttp_port) 163 os.path.join(constants.DIR_SOURCE_ROOT), self._lighttp_port)
164 if self.flags: 164 if self.flags:
165 self.flags.AddFlags(['--disable-fre', '--enable-test-intents']) 165 self.flags.AddFlags(['--disable-fre', '--enable-test-intents'])
166 if self.options.device_flags:
167 with open(self.options.device_flags) as device_flags_file:
168 self.flags.AddFlags([flag for flag in device_flags_file])
166 169
167 def TearDown(self): 170 def TearDown(self):
168 """Cleans up the test harness and saves outstanding data from test run.""" 171 """Cleans up the test harness and saves outstanding data from test run."""
169 if self.flags: 172 if self.flags:
170 self.flags.Restore() 173 self.flags.Restore()
171 super(TestRunner, self).TearDown() 174 super(TestRunner, self).TearDown()
172 175
173 def TestSetup(self, test): 176 def TestSetup(self, test):
174 """Sets up the test harness for running a particular test. 177 """Sets up the test harness for running a particular test.
175 178
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 timeout_scale = int(scale_match.group(1)) 315 timeout_scale = int(scale_match.group(1))
313 if self.options.wait_for_debugger: 316 if self.options.wait_for_debugger:
314 timeout_scale *= 100 317 timeout_scale *= 100
315 return timeout_scale 318 return timeout_scale
316 319
317 def _GetIndividualTestTimeoutSecs(self, test): 320 def _GetIndividualTestTimeoutSecs(self, test):
318 """Returns the timeout in seconds for the given |test|.""" 321 """Returns the timeout in seconds for the given |test|."""
319 annotations = self.test_pkg.GetTestAnnotations(test) 322 annotations = self.test_pkg.GetTestAnnotations(test)
320 if 'Manual' in annotations: 323 if 'Manual' in annotations:
321 return 10 * 60 * 60 324 return 10 * 60 * 60
325 if 'IntegrationTest' in annotations:
326 return 30 * 60
322 if 'External' in annotations: 327 if 'External' in annotations:
323 return 10 * 60 328 return 10 * 60
324 if 'EnormousTest' in annotations: 329 if 'EnormousTest' in annotations:
325 return 10 * 60 330 return 10 * 60
326 if 'LargeTest' in annotations or _PERF_TEST_ANNOTATION in annotations: 331 if 'LargeTest' in annotations or _PERF_TEST_ANNOTATION in annotations:
327 return 5 * 60 332 return 5 * 60
328 if 'MediumTest' in annotations: 333 if 'MediumTest' in annotations:
329 return 3 * 60 334 return 3 * 60
330 if 'SmallTest' in annotations: 335 if 'SmallTest' in annotations:
331 return 1 * 60 336 return 1 * 60
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 duration_ms = 0 429 duration_ms = 0
425 message = str(e) 430 message = str(e)
426 if not message: 431 if not message:
427 message = 'No information.' 432 message = 'No information.'
428 results.AddResult(test_result.InstrumentationTestResult( 433 results.AddResult(test_result.InstrumentationTestResult(
429 test, base_test_result.ResultType.CRASH, start_date_ms, duration_ms, 434 test, base_test_result.ResultType.CRASH, start_date_ms, duration_ms,
430 log=message)) 435 log=message))
431 raw_result = None 436 raw_result = None
432 self.TestTeardown(test, raw_result) 437 self.TestTeardown(test, raw_result)
433 return (results, None if results.DidRunPass() else test) 438 return (results, None if results.DidRunPass() else test)
OLDNEW
« no previous file with comments | « build/android/pylib/instrumentation/test_options.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698