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

Unified Diff: ios/build/bots/scripts/test_runner.py

Issue 2618163002: Raise an exception if test data or crash reports can't be copied off a device (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/build/bots/scripts/test_runner.py
diff --git a/ios/build/bots/scripts/test_runner.py b/ios/build/bots/scripts/test_runner.py
index 8027d65a9e8da3d3683aabe1eeabde49b8901344..b06cbbbec003d78f2719b11d3a31af3358754df0 100644
--- a/ios/build/bots/scripts/test_runner.py
+++ b/ios/build/bots/scripts/test_runner.py
@@ -71,6 +71,12 @@ class SimulatorNotFoundError(TestRunnerError):
'Simulator does not exist: %s' % iossim_path)
+class TestDataExtractionError(TestRunnerError):
+ """Error extracting test data or crash reports from a device."""
+ def __init__(self):
+ super(TestDataExtractionError, self).__init__('Failed to extract test data')
+
+
class XcodeVersionNotFoundError(TestRunnerError):
"""The requested version of Xcode was not found."""
def __init__(self, xcode_version):
@@ -601,30 +607,36 @@ class DeviceTestRunner(TestRunner):
def extract_test_data(self):
"""Extracts data emitted by the test."""
- subprocess.check_call([
- 'idevicefs',
- '--udid', self.udid,
- 'pull',
- '@%s/Documents' % self.cfbundleid,
- os.path.join(self.out_dir, 'Documents'),
- ])
+ try:
+ subprocess.check_call([
+ 'idevicefs',
+ '--udid', self.udid,
+ 'pull',
+ '@%s/Documents' % self.cfbundleid,
+ os.path.join(self.out_dir, 'Documents'),
+ ])
+ except subprocess.CalledProcessError:
+ raise TestDataExtractionError()
def retrieve_crash_reports(self):
"""Retrieves crash reports produced by the test."""
logs_dir = os.path.join(self.out_dir, 'Logs')
os.mkdir(logs_dir)
- subprocess.check_call([
- 'idevicecrashreport',
- '--extract',
- '--udid', self.udid,
- logs_dir,
- ])
+ try:
+ subprocess.check_call([
+ 'idevicecrashreport',
+ '--extract',
+ '--udid', self.udid,
+ logs_dir,
+ ])
+ except subprocess.CalledProcessError:
+ raise TestDataExtractionError()
def tear_down(self):
"""Performs cleanup actions which must occur after every test launch."""
+ self.screenshot_desktop()
self.extract_test_data()
self.retrieve_crash_reports()
- self.screenshot_desktop()
self.uninstall_apps()
def get_launch_command(self, test_filter=None, invert=False):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698