Skip to content

Bundle imported frameworks required by iOS test frameworks - #3082

Merged
brentleyjones merged 1 commit into
bazelbuild:mainfrom
brentleyjones:bj/test-framework-imports
Oct 17, 2026
Merged

brentleyjones merged 1 commit into
bazelbuild:mainfrom
brentleyjones:bj/test-framework-imports

Conversation

@brentleyjones

@brentleyjones brentleyjones commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

iOS test bundles can omit an imported dynamic framework when it is reachable only through a target in frameworks, rather than through the test's deps. The built framework is embedded, but its imported dependency is missing, which can cause a Library not loaded failure when the test bundle loads.

This brings test-bundle packaging in line with ios_application, which already collects imported frameworks through both deps and frameworks (as well as extensions). Built frameworks propagate their imported dependencies without embedding them, so the enclosing app or test bundle must package those imports alongside the built frameworks.

Propagate framework-import information through the unit and UI test frameworks attributes, and collect imports from both deps and frameworks during bundling. Continue excluding imports supplied by an in-process unit-test host. UI tests must package their own imports because their host runs in a separate process.

Adds archive-content regression tests for unit and UI tests, plus a check that imports already supplied by a unit-test host remain excluded.

Testing

  • Confirmed the new unit and UI import-packaging tests fail without the fix because the imported framework is absent.
  • bazel test //test/starlark_tests:ios_unit_test //test/starlark_tests:ios_ui_test --test_output=errors — all 36 tests pass with the fix.
  • Buildifier formatting and lint checks pass.

@brentleyjones
brentleyjones marked this pull request as ready for review September 22, 2026 22:46
@brentleyjones
brentleyjones enabled auto-merge (squash) September 24, 2026 20:24
Collect binary framework imports through test framework dependencies as well as source dependencies. Built frameworks propagate these imports without embedding them, so only imports supplied by the bundle loader should be excluded.

Add archive regression tests for unit and UI tests, including preserving host deduplication for unit tests and embedding imports independently of the out-of-process UI test host.
@brentleyjones
brentleyjones force-pushed the bj/test-framework-imports branch from 20d74f0 to b889394 Compare October 13, 2026 14:20
@brentleyjones brentleyjones added the AI Generated Changes prepared with AI assistance label Oct 13, 2026
@brentleyjones
brentleyjones merged commit 06f641f into bazelbuild:main Oct 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Changes prepared with AI assistance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants