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

Side by Side Diff: tools/testrunner/local/execution.py

Issue 1874973003: [test] Simplify progress indicators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | tools/testrunner/local/progress.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 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 # Rerun this test. 242 # Rerun this test.
243 test.duration = None 243 test.duration = None
244 test.output = None 244 test.output = None
245 test.run += 1 245 test.run += 1
246 pool.add([TestJob(test)]) 246 pool.add([TestJob(test)])
247 self.remaining += 1 247 self.remaining += 1
248 self.total += 1 248 self.total += 1
249 249
250 def _ProcessTestNormal(self, test, result, pool): 250 def _ProcessTestNormal(self, test, result, pool):
251 self.indicator.AboutToRun(test)
252 test.output = result[1] 251 test.output = result[1]
253 test.duration = result[2] 252 test.duration = result[2]
254 has_unexpected_output = test.suite.HasUnexpectedOutput(test) 253 has_unexpected_output = test.suite.HasUnexpectedOutput(test)
255 if has_unexpected_output: 254 if has_unexpected_output:
256 self.failed.append(test) 255 self.failed.append(test)
257 if test.output.HasCrashed(): 256 if test.output.HasCrashed():
258 self.crashed += 1 257 self.crashed += 1
259 else: 258 else:
260 self.succeeded += 1 259 self.succeeded += 1
261 self.remaining -= 1 260 self.remaining -= 1
(...skipping 16 matching lines...) Expand all
278 self.printed_allocations = True 277 self.printed_allocations = True
279 return line 278 return line
280 return "" 279 return ""
281 return (AllocationStr(output1.stdout) != AllocationStr(output2.stdout)) 280 return (AllocationStr(output1.stdout) != AllocationStr(output2.stdout))
282 281
283 # Always pass the test duration for the database update. 282 # Always pass the test duration for the database update.
284 test.duration = result[2] 283 test.duration = result[2]
285 if test.run == 1 and result[1].HasTimedOut(): 284 if test.run == 1 and result[1].HasTimedOut():
286 # If we get a timeout in the first run, we are already in an 285 # If we get a timeout in the first run, we are already in an
287 # unpredictable state. Just report it as a failure and don't rerun. 286 # unpredictable state. Just report it as a failure and don't rerun.
288 self.indicator.AboutToRun(test)
289 test.output = result[1] 287 test.output = result[1]
290 self.remaining -= 1 288 self.remaining -= 1
291 self.failed.append(test) 289 self.failed.append(test)
292 self.indicator.HasRun(test, True) 290 self.indicator.HasRun(test, True)
293 if test.run > 1 and HasDifferentAllocations(test.output, result[1]): 291 if test.run > 1 and HasDifferentAllocations(test.output, result[1]):
294 # From the second run on, check for different allocations. If a 292 # From the second run on, check for different allocations. If a
295 # difference is found, call the indicator twice to report both tests. 293 # difference is found, call the indicator twice to report both tests.
296 # All runs of each test are counted as one for the statistic. 294 # All runs of each test are counted as one for the statistic.
297 self.indicator.AboutToRun(test)
298 self.remaining -= 1 295 self.remaining -= 1
299 self.failed.append(test) 296 self.failed.append(test)
300 self.indicator.HasRun(test, True) 297 self.indicator.HasRun(test, True)
301 self.indicator.AboutToRun(test)
302 test.output = result[1] 298 test.output = result[1]
303 self.indicator.HasRun(test, True) 299 self.indicator.HasRun(test, True)
304 elif test.run >= 3: 300 elif test.run >= 3:
305 # No difference on the third run -> report a success. 301 # No difference on the third run -> report a success.
306 self.indicator.AboutToRun(test)
307 self.remaining -= 1 302 self.remaining -= 1
308 self.succeeded += 1 303 self.succeeded += 1
309 test.output = result[1] 304 test.output = result[1]
310 self.indicator.HasRun(test, False) 305 self.indicator.HasRun(test, False)
311 else: 306 else:
312 # No difference yet and less than three runs -> add another run and 307 # No difference yet and less than three runs -> add another run and
313 # remember the output for comparison. 308 # remember the output for comparison.
314 test.run += 1 309 test.run += 1
315 test.output = result[1] 310 test.output = result[1]
316 pool.add([TestJob(test)]) 311 pool.add([TestJob(test)])
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 if self.context.verbose: 380 if self.context.verbose:
386 print text 381 print text
387 sys.stdout.flush() 382 sys.stdout.flush()
388 383
389 384
390 class BreakNowException(Exception): 385 class BreakNowException(Exception):
391 def __init__(self, value): 386 def __init__(self, value):
392 self.value = value 387 self.value = value
393 def __str__(self): 388 def __str__(self):
394 return repr(self.value) 389 return repr(self.value)
OLDNEW
« no previous file with comments | « no previous file | tools/testrunner/local/progress.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698