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

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

Issue 2581553004: Store tombstones url, not the actual tombstones, inside test result. (Closed)
Patch Set: fixes Created 4 years 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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 itertools 6 import itertools
7 import logging 7 import logging
8 import os 8 import os
9 import posixpath 9 import posixpath
10 import time
10 11
11 from devil.android import device_errors 12 from devil.android import device_errors
12 from devil.android import device_temp_file 13 from devil.android import device_temp_file
13 from devil.android import ports 14 from devil.android import ports
14 from devil.utils import reraiser_thread 15 from devil.utils import reraiser_thread
15 from pylib import constants 16 from pylib import constants
16 from pylib.base import base_test_result 17 from pylib.base import base_test_result
17 from pylib.gtest import gtest_test_instance 18 from pylib.gtest import gtest_test_instance
18 from pylib.local import local_test_server_spawner 19 from pylib.local import local_test_server_spawner
19 from pylib.local.device import local_device_environment 20 from pylib.local.device import local_device_environment
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 if self._test_instance.enable_xml_result_parsing: 408 if self._test_instance.enable_xml_result_parsing:
408 results = gtest_test_instance.ParseGTestXML(gtest_xml) 409 results = gtest_test_instance.ParseGTestXML(gtest_xml)
409 else: 410 else:
410 results = gtest_test_instance.ParseGTestOutput(output) 411 results = gtest_test_instance.ParseGTestOutput(output)
411 412
412 # Check whether there are any crashed testcases. 413 # Check whether there are any crashed testcases.
413 self._crashes.update(r.GetName() for r in results 414 self._crashes.update(r.GetName() for r in results
414 if r.GetType() == base_test_result.ResultType.CRASH) 415 if r.GetType() == base_test_result.ResultType.CRASH)
415 416
416 if self._test_instance.store_tombstones: 417 if self._test_instance.store_tombstones:
417 resolved_tombstones = None 418 tombstones_url = None
418 for result in results: 419 for result in results:
419 if result.GetType() == base_test_result.ResultType.CRASH: 420 if result.GetType() == base_test_result.ResultType.CRASH:
420 if not resolved_tombstones: 421 if not tombstones_url:
421 resolved_tombstones = '\n'.join(tombstones.ResolveTombstones( 422 resolved_tombstones = tombstones.ResolveTombstones(
422 device, 423 device,
423 resolve_all_tombstones=True, 424 resolve_all_tombstones=True,
424 include_stack_symbols=False, 425 include_stack_symbols=False,
425 wipe_tombstones=True)) 426 wipe_tombstones=True)
426 result.SetTombstones(resolved_tombstones) 427 stream_name = 'tombstones_%s_%s' % (
428 time.strftime('%Y%m%dT%H%M%S', time.localtime()),
429 device.serial)
430 tombstones_url = tombstones.LogdogTombstones(resolved_tombstones,
431 stream_name)
432 result.SetTombstonesUrl(tombstones_url)
427 433
428 not_run_tests = set(test).difference(set(r.GetName() for r in results)) 434 not_run_tests = set(test).difference(set(r.GetName() for r in results))
429 return results, list(not_run_tests) 435 return results, list(not_run_tests)
430 436
431 #override 437 #override
432 def TearDown(self): 438 def TearDown(self):
433 @local_device_environment.handle_shard_failures 439 @local_device_environment.handle_shard_failures
434 def individual_device_tear_down(dev): 440 def individual_device_tear_down(dev):
435 for s in self._servers.get(str(dev), []): 441 for s in self._servers.get(str(dev), []):
436 s.TearDown() 442 s.TearDown()
437 443
438 tool = self.GetTool(dev) 444 tool = self.GetTool(dev)
439 tool.CleanUpEnvironment() 445 tool.CleanUpEnvironment()
440 446
441 self._env.parallel_devices.pMap(individual_device_tear_down) 447 self._env.parallel_devices.pMap(individual_device_tear_down)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698