bluepill: (BLUEPILL) Failed to read data for UIABCTests - ERROR: Failed to load some test bundles

Hello, First time using bluepill.

I installed bluepill through brew install bluepill

I build my app by running the following command: xcodebuild -workspace MY.xcworkspace -scheme "UIABCTests" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro Max' build-for-testing | xcbeautify

I got the xctestrun from Library/Developer/Xcode/DerivedData/name/Build/Products/UIABCTests_iphonesimulator16.0-arm64.xctestrun

AND the app from Library/Developer/Xcode/DerivedData/name/Build/Products/Debug-iphonesimulator/NameApp.app

Running this command:

     bluepill --xctestrun-path ./UIABCTests_iphonesimulator16.0-arm64.xctestrun -o ./output/

OR

{ 
   "app": "~/Desktop/NameApp.app",
   "xctestrun-path": "~/Desktop/UIABCTests_iphonesimulator16.0-arm64.xctestrun",
   "output-dir": "./build/" 
}

Also tried adding "unsafe-skip-xcode-version-check": "yes" to the abovejson` but did not work. and also tried

bluepill --unsafe-skip-xcode-version-check YES --xctestrun-path UIABCTests_iphonesimulator16.0-arm64.xctestrun -o ./output

no luck either 😦.

gives me this error

2022-10-28 18:35:16.764 bluepill[37085:345815] Debug Enabled == 0
{37085} 20221028.183517 [  INFO  ] (BLUEPILL) Using xctestrun configuration
{37085} 20221028.183517 [  ERROR ] (BLUEPILL) Failed to read data for UIABCTests
ERROR: Failed to load some test bundles

bluepill version: Bluepill v5.12.1 xcode version: Version 14.0.1 (14A400) OS: 13.0 (22A380)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (5 by maintainers)

Most upvoted comments

So I just tried it with the app you uploaded and it seems to work. All I did was download Simple App and run:

 xcodebuild -workspace simpleapp.xcworkspace -scheme "Simple App" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro Max' build-for-testing

then

bluepill --xctestrun-path '/Users/ob/Library/Developer/Xcode/DerivedData/simpleapp-fzrsvuwogsmknrhjifszqxxscbin/Build/Products/Simple App_iphonesimulator16.0-arm64.xctestrun' --output-dir ./build

and it works for me. This is with the latest bluepill (built from master) and Xcode 14.0.1. I even diffed the .xctestrun file produced by Xcode for my build with the one you uploaded and they both look identical.

Like I said before, I think you’ll need to build it and fix the errPtr to see what’s going on in your machine.

@parikhparth23 you’d need to change the arguments of the bptestrunner repository rule and use a newer version of Bluepil though.

@ob after building the latest(master) locally, the test ran fine…thank you for the help.

I am building my app using the following command: bazelisk build --config=Debug /MyApp

how do I run bluepill with bazel?

bluepill --test-plan-path '<WHAT IS THE VALUE>' --output-dir ./build

What is the value I need to use for test-plan-path?

I am not able to understand this from the README:

test-plan-path ->

The path of a json file which describes the test plan. 
It is equivalent to the .xctestrun file generated by Xcode, 
but it can be generated by a different build system, e.g. Bazel

@parikhparth23 good question, we should have put some documentation for the Bazel rule.

There are three steps

  1. you need to import the Bluepill package in your WORKSPACE as a repository rule. e.g
http_archive(
    name = "bptestrunner",
    sha256 = "6b11eb3e36680efa9f183daf1d932477c696e998d0cdf3ba3798bf8b98c05531",
    url = "https://github.com/MobileNativeFoundation/bluepill/releases/download/v5.11.0/Bluepill-v5.11.0.zip",
    strip_prefix = "Bluepill-v5.11.0",
)
  1. load the bptestrunner rule in your BUILD file
load("@bptestrunner//:bluepill_batch_test.bzl", "bluepill_batch_test")
  1. have a bluepill test rule in your BUILD file
bluepill_batch_test(
    name = "FooTests",
    test_targets = [
        "BarTests" # an ios_unit_test or ios_ui_test rule from rules_apple or rules_ios
    ],
    config_file = "baz/config.json",  # path to the bluepill config file
)

@ob i am running the brew version and not compiling locally. So I don’t think adding errPtr will help.