| OLD | NEW |
| 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 import time |
| 11 | 11 |
| 12 from devil.android import device_errors | 12 from devil.android import device_errors |
| 13 from devil.android import device_temp_file | 13 from devil.android import device_temp_file |
| 14 from devil.android import ports | 14 from devil.android import ports |
| 15 from devil.utils import reraiser_thread | 15 from devil.utils import reraiser_thread |
| 16 from pylib import constants | 16 from pylib import constants |
| 17 from pylib.base import base_test_result | 17 from pylib.base import base_test_result |
| 18 from pylib.gtest import gtest_test_instance | 18 from pylib.gtest import gtest_test_instance |
| 19 from pylib.local import local_test_server_spawner | 19 from pylib.local import local_test_server_spawner |
| 20 from pylib.local.device import local_device_environment | 20 from pylib.local.device import local_device_environment |
| 21 from pylib.local.device import local_device_test_run | 21 from pylib.local.device import local_device_test_run |
| 22 from pylib.utils import logdog_helper |
| 22 from py_trace_event import trace_event | 23 from py_trace_event import trace_event |
| 23 from py_utils import contextlib_ext | 24 from py_utils import contextlib_ext |
| 24 import tombstones | 25 import tombstones |
| 25 | 26 |
| 26 _MAX_INLINE_FLAGS_LENGTH = 50 # Arbitrarily chosen. | 27 _MAX_INLINE_FLAGS_LENGTH = 50 # Arbitrarily chosen. |
| 27 _EXTRA_COMMAND_LINE_FILE = ( | 28 _EXTRA_COMMAND_LINE_FILE = ( |
| 28 'org.chromium.native_test.NativeTest.CommandLineFile') | 29 'org.chromium.native_test.NativeTest.CommandLineFile') |
| 29 _EXTRA_COMMAND_LINE_FLAGS = ( | 30 _EXTRA_COMMAND_LINE_FLAGS = ( |
| 30 'org.chromium.native_test.NativeTest.CommandLineFlags') | 31 'org.chromium.native_test.NativeTest.CommandLineFlags') |
| 31 _EXTRA_STDOUT_FILE = ( | 32 _EXTRA_STDOUT_FILE = ( |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 if result.GetType() == base_test_result.ResultType.CRASH: | 427 if result.GetType() == base_test_result.ResultType.CRASH: |
| 427 if not tombstones_url: | 428 if not tombstones_url: |
| 428 resolved_tombstones = tombstones.ResolveTombstones( | 429 resolved_tombstones = tombstones.ResolveTombstones( |
| 429 device, | 430 device, |
| 430 resolve_all_tombstones=True, | 431 resolve_all_tombstones=True, |
| 431 include_stack_symbols=False, | 432 include_stack_symbols=False, |
| 432 wipe_tombstones=True) | 433 wipe_tombstones=True) |
| 433 stream_name = 'tombstones_%s_%s' % ( | 434 stream_name = 'tombstones_%s_%s' % ( |
| 434 time.strftime('%Y%m%dT%H%M%S', time.localtime()), | 435 time.strftime('%Y%m%dT%H%M%S', time.localtime()), |
| 435 device.serial) | 436 device.serial) |
| 436 tombstones_url = tombstones.LogdogTombstones(resolved_tombstones, | 437 tombstones_url = logdog_helper.text( |
| 437 stream_name) | 438 stream_name, resolved_tombstones) |
| 438 result.SetTombstonesUrl(tombstones_url) | 439 result.SetLink('tombstones', tombstones_url) |
| 439 | 440 |
| 440 not_run_tests = set(test).difference(set(r.GetName() for r in results)) | 441 not_run_tests = set(test).difference(set(r.GetName() for r in results)) |
| 441 return results, list(not_run_tests) if results else None | 442 return results, list(not_run_tests) if results else None |
| 442 | 443 |
| 443 #override | 444 #override |
| 444 def TearDown(self): | 445 def TearDown(self): |
| 445 @local_device_environment.handle_shard_failures | 446 @local_device_environment.handle_shard_failures |
| 446 @trace_event.traced | 447 @trace_event.traced |
| 447 def individual_device_tear_down(dev): | 448 def individual_device_tear_down(dev): |
| 448 for s in self._servers.get(str(dev), []): | 449 for s in self._servers.get(str(dev), []): |
| 449 s.TearDown() | 450 s.TearDown() |
| 450 | 451 |
| 451 tool = self.GetTool(dev) | 452 tool = self.GetTool(dev) |
| 452 tool.CleanUpEnvironment() | 453 tool.CleanUpEnvironment() |
| 453 | 454 |
| 454 self._env.parallel_devices.pMap(individual_device_tear_down) | 455 self._env.parallel_devices.pMap(individual_device_tear_down) |
| OLD | NEW |