Chromium Code Reviews| 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 | 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 Loading... | |
| 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 resolved_tombstones = None |
|
jbudorick
2016/12/15 22:31:35
Should we switch this & the if check below to tomb
BigBossZhiling
2016/12/20 19:34:08
Done.
| |
| 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 resolved_tombstones: |
| 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_%s' % ( |
|
jbudorick
2016/12/15 22:31:35
That said, this stream name may be confusing if we
BigBossZhiling
2016/12/20 19:34:08
Done.
| |
| 428 result.GetName(), | |
| 429 time.strftime('%Y%m%dT%H%M%S', time.localtime()), | |
| 430 device.serial) | |
| 431 tombstones_url = tombstones.LogdogTombstones(resolved_tombstones, | |
| 432 stream_name) | |
| 433 result.SetTombstonesUrl(tombstones_url) | |
| 427 | 434 |
| 428 not_run_tests = set(test).difference(set(r.GetName() for r in results)) | 435 not_run_tests = set(test).difference(set(r.GetName() for r in results)) |
| 429 return results, list(not_run_tests) | 436 return results, list(not_run_tests) |
| 430 | 437 |
| 431 #override | 438 #override |
| 432 def TearDown(self): | 439 def TearDown(self): |
| 433 @local_device_environment.handle_shard_failures | 440 @local_device_environment.handle_shard_failures |
| 434 def individual_device_tear_down(dev): | 441 def individual_device_tear_down(dev): |
| 435 for s in self._servers.get(str(dev), []): | 442 for s in self._servers.get(str(dev), []): |
| 436 s.TearDown() | 443 s.TearDown() |
| 437 | 444 |
| 438 tool = self.GetTool(dev) | 445 tool = self.GetTool(dev) |
| 439 tool.CleanUpEnvironment() | 446 tool.CleanUpEnvironment() |
| 440 | 447 |
| 441 self._env.parallel_devices.pMap(individual_device_tear_down) | 448 self._env.parallel_devices.pMap(individual_device_tear_down) |
| OLD | NEW |