Commit 71989eb4 authored by Maksym Onufriienko's avatar Maksym Onufriienko Committed by Commit Bot

[ios_runner]Added TestHostBundleIdentifier to xctestrun.

After XC11.4+ TestHostBundleIdentifier is required key in xctestrun,
otherwise tests fail wit error

xcodebuild[51335:6042032] [MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-16118.3/IDEFoundation/Testing/IDETestRunSpecification.m:818
   (self.bundleIdForTestHost) should not be nil.
   <IDETestRunSpecification: 0x7fa7b9bcd950>
   Method:   -bundleIdentifierForInstallationTracking

Fixed: 1054223
Change-Id: Ie8f7b222d3422a5629c755e05a28701a7e6c2395
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2065420
Commit-Queue: Maksym Onufriienko <monufriienko@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744343}
parent f23086a9
......@@ -5,6 +5,7 @@
import os
import plistlib
import subprocess
import time
import test_runner
......@@ -51,6 +52,20 @@ def get_gtest_filter(tests, invert=False):
return test_filter
def get_bundle_id(app_path):
"""Get bundle identifier for app.
Args:
app_path: (str) A path to app.
"""
return subprocess.check_output([
'/usr/libexec/PlistBuddy',
'-c',
'Print:CFBundleIdentifier',
os.path.join(app_path, 'Info.plist'),
]).rstrip()
class GTestsApp(object):
"""Gtests app to run.
......@@ -140,6 +155,7 @@ class GTestsApp(object):
module_data = {
'TestBundlePath': self.test_app_path,
'TestHostPath': self.test_app_path,
'TestHostBundleIdentifier': get_bundle_id(self.test_app_path),
'TestingEnvironmentVariables': {
'DYLD_LIBRARY_PATH':
'%s:__PLATFORMS__/iPhoneSimulator.platform/Developer/Library' %
......
......@@ -439,11 +439,7 @@ class TestRunner(object):
self.app_name = os.path.splitext(os.path.split(app_path)[-1])[0]
self.app_path = app_path
self.cfbundleid = subprocess.check_output([
'/usr/libexec/PlistBuddy',
'-c', 'Print:CFBundleIdentifier',
os.path.join(app_path, 'Info.plist'),
]).rstrip()
self.cfbundleid = test_apps.get_bundle_id(app_path)
self.env_vars = env_vars or []
self.logs = collections.OrderedDict()
self.out_dir = out_dir
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment