Skip to content

Commit 70e0e27

Browse files
sewerynplazukSeweryn Plażuk
andauthored
Collect framework dSYMs in test bundle debug dependencies (#2742)
This PR fixes dSYM collection for frameworks specified in the `frameworks` attribute of `ios_ui_test` targets. Currently, while framework binaries are properly made available to test targets, their corresponding dSYM files are not collected in the test bundle's debug symbol directory. This causes missing debug symbols when debugging test failures that involve framework code. The fix ensures that dSYMs from framework dependencies are included alongside dSYMs from regular dependencies specified in the `deps` attribute. --------- Co-authored-by: Seweryn Plażuk <[email protected]>
1 parent 5e7139e commit 70e0e27

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

apple/internal/testing/apple_test_bundle_support.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,12 @@ def _apple_test_bundle_impl(*, ctx, product_type):
412412
debug_dependencies.append(test_host)
413413

414414
if hasattr(ctx.attr, "frameworks"):
415-
targets_to_avoid = list(ctx.attr.frameworks)
415+
frameworks = list(ctx.attr.frameworks)
416+
targets_to_avoid = frameworks
417+
debug_dependencies.extend(frameworks)
416418
else:
417419
targets_to_avoid = []
420+
418421
if bundle_loader:
419422
targets_to_avoid.append(bundle_loader)
420423

test/starlark_tests/ios_ui_test_tests.bzl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,33 @@ def ios_ui_test_test_suite(name):
137137
tags = [name],
138138
)
139139

140+
analysis_output_group_info_files_test(
141+
name = "{}_dsyms_output_group_files_with_fmwk_test".format(name),
142+
target_under_test = "//test/starlark_tests/targets_under_test/ios:ui_test_with_fmwk",
143+
output_group_name = "dsyms",
144+
expected_outputs = [
145+
"app.app.dSYM/Contents/Info.plist",
146+
"app.app.dSYM/Contents/Resources/DWARF/app",
147+
"ui_test_with_fmwk.xctest.dSYM/Contents/Info.plist",
148+
"ui_test_with_fmwk.xctest.dSYM/Contents/Resources/DWARF/ui_test_with_fmwk",
149+
"fmwk.framework.dSYM/Contents/Info.plist",
150+
"fmwk.framework.dSYM/Contents/Resources/DWARF/fmwk",
151+
],
152+
tags = [name],
153+
)
154+
155+
apple_dsym_bundle_info_test(
156+
name = "{}_apple_dsym_bundle_info_with_fmwk_test".format(name),
157+
target_under_test = "//test/starlark_tests/targets_under_test/ios:ui_test_with_fmwk",
158+
expected_direct_dsyms = ["dSYMs/ui_test_with_fmwk.xctest.dSYM"],
159+
expected_transitive_dsyms = [
160+
"dSYMs/app.app.dSYM",
161+
"dSYMs/ui_test_with_fmwk.xctest.dSYM",
162+
"dSYMs/fmwk.framework.dSYM",
163+
],
164+
tags = [name],
165+
)
166+
140167
infoplist_contents_test(
141168
name = "{}_base_bundle_id_derived_bundle_id_plist_test".format(name),
142169
target_under_test = "//test/starlark_tests/targets_under_test/ios:ui_test_with_base_bundle_id_derived_bundle_id",

0 commit comments

Comments
 (0)