Closed parikhparth23 closed 1 year ago
@oliverhu can you plz help with this issue?
Can you enable verbose logging to see why it might have failed? It's the --verbose
flag. Thanks!
@ob running with --verbose
flag
bluepill -c config.json --verbose
2022-10-31 10:26:13.790 bluepill[2437:23880] Debug Enabled == 1
{2437} 20221031.102614 [ DEBUG ] (BLUEPILL) xcode build version: Xcode 14.0.1
Build version 14A400
{2437} 20221031.102614 [ INFO ] (BLUEPILL) Using xctestrun configuration
{2437} 20221031.102614 [ ERROR ] (BLUEPILL) Failed to read data for UIEventsTests
ERROR: Failed to load some test bundles
@ob i am running the brew version and not compiling locally. So I don't think adding errPtr
will help.
Could you post your .xctestrun
file?
@ob sure, let me upload it here
Hi Oscar,
Here is the
App, config.JSON and xctestrun
app, xctestrun, config.json.zip
Full app - Simple App.zip
command i used:
xcodebuild -workspace simpleapp.xcworkspace -scheme "Simple App" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro Max' build-for-testing | xcbeautify
bluepill -c config.json --verbose
i am getting the same error:
bluepill -c config.json --verbose
Debug Enabled == 1
{6569} 20221031.114948 [ DEBUG ] (BLUEPILL) xcode build version: Xcode 14.0.1
Build version 14A400
{6569} 20221031.114948 [ INFO ] (BLUEPILL) Using xctestrun configuration
{6569} 20221031.114948 [ ERROR ] (BLUEPILL) Failed to read data for Simple AppTests
{6569} 20221031.114948 [ ERROR ] (BLUEPILL) Failed to read data for Simple AppUITests
ERROR: Failed to load some test bundles
bluepill version: Bluepill v5.12.1 xcode version: Version 14.0.1 (14A400) OS: 13.0 (22A380)
HI @ob , would appreciate your response.
Just eyeballing the .xctestrun
file it looks correct... without printing out the errPtr
where I mentioned in this comment it'll be very hard to figure out what's going on... there's too many code paths.
I would suggest either compiling bluepill from source and adding the missing errPtr
(PR welcome) or waiting for me to add it and producing a new release.
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.
@ob , thank you for trying on your end. let me try on my end
@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
@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
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",
)
load the bptestrunner rule in your BUILD file
load("@bptestrunner//:bluepill_batch_test.bzl", "bluepill_batch_test")
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
)
Thank you @chenxiao0228
let me try those steps
@parikhparth23 you'd need to change the arguments of the bptestrunner repository rule and use a newer version of Bluepil though.
thank you @chenxiao0228, will change the arguments of the bptestrunner repository rule and use a newer version of Bluepill
@chenxiao0228 what if i want to use locally build version?
Above solution mentioned by @ob worked. closing this issue.
@chenxiao0228 what if i want to use locally build version?
You can run the same commands in Bluepill's repo that builds the release archive, then you can either
local_repository
rulehttp_archive
rule, but with a file://
URL
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
fromLibrary/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:
OR
Also tried adding
"unsafe-skip-xcode-version-check": "yes" to the above
json` but did not work. and also triedno luck either :(.
gives me this error
bluepill version: Bluepill v5.12.1 xcode version: Version 14.0.1 (14A400) OS: 13.0 (22A380)