bazelbuild / bazelbuild/rules_apple

`ios_unit_test` doesn't include bundles provided to `data` when using a test host

Open
#2,876 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
593
Forks
334
Avg merge
16h 48m
Merged PRs (30d)
9

Description

Resource bundles provided as `data` arguments to `ios_unit_test`s aren't bundled into the final `.xctest` bundle when using `test_host`.
It is included if `test_host` is `None` or if the bundle is provided to the `resources` argument instead.

```
apple_precompiled_resource_bundle(
name = "SnapshotsData",
bundle_id = "com.jflan.SnapshotsData",
bundle_name = "Snapshots",
infoplists = ["Info.plist],
structured_resources = snapshot_images,
tags = ["manual"],
)

ios_unit_test(
name = "UnitTests",
data = [":SnapshotsData"], # has to be `resources` to work with `test_host`
minimum_os_version = minimum_os_version,
runner = test_runner,
test_host = "//MyApp",
visibility = ["//visibility:public"],
deps = [":UnitTests.library"],
)
```

Contributor guide

Open the contributing guide

Research direction

Start at the ios_unit_test handling for data, resources, and test_host, using the supplied apple_precompiled_resource_bundle example to reproduce the missing bundle. Done means a resource bundle passed through data is included in the final .xctest bundle when test_host is set, as it is without a host or through resources.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.