rules_xcodeproj icon indicating copy to clipboard operation
rules_xcodeproj copied to clipboard

Bug: Unit Test fails to run on focused project

Open yongjincho92 opened this issue 2 years ago • 2 comments

Description

Unit test execution fails due to missing xcframework in Xcode project generated with unit test target as a focused target

Reproduction steps

Repro steps are provided in the following change : https://github.com/MobileNativeFoundation/rules_xcodeproj/pull/2165

Expected behavior

Tests should succeed

rules_xcodeproj version

7efb52807d2ff37be1ed161f992c0ec1c635b1d0

Xcode version

14.1

Bazel version

6.1

rules_apple version

n/a

rules_swift version

n/a

Additional information

No response

yongjincho92 avatar May 10 '23 00:05 yongjincho92

We saw this bug as well. The reason is because the test_host for the test target is unfocused, so I believe it doesn't get copied into Xcode. The workaround is to add the test_host (in your example //iOSApp/Source:iOSApp) to focused_targets. That should fix it. In any case, there's probably something we can do on our side here to add the test_host automatically to focused_targets or copy them directly.

BalestraPatrick avatar May 10 '23 08:05 BalestraPatrick

Yeah, similar to how in BwX mode we require various dependencies to stay focused, we probably need to unconditionally keep the test host of a target focused as well.

brentleyjones avatar May 10 '23 11:05 brentleyjones