Closed revolter closed 6 years ago
xctool doesn't currently support UITests. Are those UITests?
No, they are Unit Tests
Can you run xctool with --showTasks
?
================================================================================
LAUNCHING TASK (finding Xcode path via xcode-select --print-path):
/usr/bin/xcode-select \
--print-path
================================================================================
================================================================================
LAUNCHING TASK (finding Xcode path via xcode-select --print-path):
/usr/bin/xcode-select \
--print-path
================================================================================
================================================================================
LAUNCHING TASK (spawning reporter task):
/usr/local/Cellar/xctool/0.3.4/libexec/reporters/pretty
================================================================================
================================================================================
LAUNCHING TASK (spawning reporter task):
/usr/local/Cellar/xctool/0.3.4/libexec/reporters/user-notifications
================================================================================
================================================================================
LAUNCHING TASK (querying available SDKs):
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild \
-sdk \
-version
================================================================================
================================================================================
LAUNCHING TASK (gathering build settings for a target):
SHOW_ONLY_BUILD_SETTINGS_FOR_FIRST_BUILDABLE=YES \
DYLD_INSERT_LIBRARIES=/usr/local/Cellar/xctool/0.3.4/libexec/lib/xcodebuild-fastsettings-shim.dylib \
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild \
-workspace \
AppName.xcworkspace \
-scheme \
"TestsSchemeName" \
-sdk \
iphonesimulator11.3 \
PLATFORM_NAME=iphonesimulator \
build \
-showBuildSettings
================================================================================
[Info] Loading settings for scheme 'TestsSchemeName' ...
================================================================================
LAUNCHING TASK (gathering build settings for a target):
SHOW_ONLY_BUILD_SETTINGS_FOR_FIRST_BUILDABLE=YES \
DYLD_INSERT_LIBRARIES=/usr/local/Cellar/xctool/0.3.4/libexec/lib/xcodebuild-fastsettings-shim.dylib \
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild \
-workspace \
AppName.xcworkspace \
-scheme \
"TestsSchemeName" \
-sdk \
iphonesimulator11.3 \
PLATFORM_NAME=iphonesimulator \
test \
-showBuildSettings
================================================================================
[Info] Loading settings for scheme 'TestsSchemeName' ... (14205 ms)
=== RUN-TESTS ===
[Info] Collecting info for testables...
================================================================================
LAUNCHING TASK (running xcodebuild -showBuildSettings for 'TestsSchemeName' target):
SHOW_ONLY_BUILD_SETTINGS_FOR_TARGET="TestsSchemeName" \
DYLD_INSERT_LIBRARIES=/usr/local/Cellar/xctool/0.3.4/libexec/lib/xcodebuild-fastsettings-shim.dylib \
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild \
-configuration \
Debug \
-sdk \
iphonesimulator11.3 \
PLATFORM_NAME=iphonesimulator \
-project \
AppName.xcodeproj \
-target \
"TestsSchemeName" \
OBJROOT=/Users/revolt/Library/Developer/Xcode/DerivedData/AppName-driwkksbyionwffehekxhjtjjqat/Build/Intermediates.noindex \
SYMROOT=/Users/revolt/Library/Developer/Xcode/DerivedData/AppName-driwkksbyionwffehekxhjtjjqat/Build/Products \
SHARED_PRECOMPS_DIR=/Users/revolt/Library/Developer/Xcode/DerivedData/AppName-driwkksbyionwffehekxhjtjjqat/Build/Intermediates.noindex/PrecompiledHeaders \
TARGETED_DEVICE_FAMILY=1,2 \
build \
-showBuildSettings
================================================================================
================================================================================
LAUNCHING TASK (running otest-query):
SIMCTL_CHILD___CFPREFERENCES_AVOID_DAEMON=YES \
SIMCTL_CHILD_DYLD_FALLBACK_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Library/Frameworks:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks \
SIMCTL_CHILD_DYLD_FRAMEWORK_PATH=/Users/revolt/Library/Developer/Xcode/DerivedData/AppName-driwkksbyionwffehekxhjtjjqat/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks \
SIMCTL_CHILD_OTEST_QUERY_OUTPUT_FILE=/var/folders/yj/l8y5kytd4tggcv7grrnpznh80000gn/T/xctool_temp_cdjUPQ/otest-query-output.VsEMuqW \
SIMCTL_CHILD_DYLD_INSERT_LIBRARIES=/usr/local/Cellar/xctool/0.3.4/libexec/lib/otest-query-lib-ios.dylib \
SIMCTL_CHILD_DYLD_LIBRARY_PATH=/Users/revolt/Library/Developer/Xcode/DerivedData/AppName-driwkksbyionwffehekxhjtjjqat/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks \
SIMCTL_CHILD_OtestQueryBundlePath="/Users/revolt/Library/Developer/Xcode/DerivedData/AppName-driwkksbyionwffehekxhjtjjqat/Build/Products/Debug-iphonesimulator/AppName.app/PlugIns/TestsSchemeName.app" \
/Applications/Xcode.app/Contents/Developer/usr/bin/simctl \
spawn \
0285E11F-2444-43EF-9F3E-6F4AAB128810 \
"/Users/revolt/Library/Developer/Xcode/DerivedData/AppName-driwkksbyionwffehekxhjtjjqat/Build/Products/Debug-iphonesimulator/AppName.app/AppName"
================================================================================
[Info] Collecting info for testables... (8125 ms)
[Info] Starting TestsSchemeName.app (0 ms)
run-test TestsSchemeName.app (iphonesimulator11.3, iPhone 5s, application-test)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Failed to query the list of test cases in the test bundle:
stdout:
stderr:
2018-05-04 21:23:08.381 AppName[83381:8264545] The bundle extension 'app' is not supported. The supported extensions are: (
xctest,
octest
).
The bundle extension 'app' is not supported.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Failures:
0) TestsSchemeName (TestsSchemeName.app)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Failed to query the list of test cases in the test bundle:
stdout:
stderr:
2018-05-04 21:23:08.381 AppName[83381:8264545] The bundle extension 'app' is not supported. The supported extensions are: (
xctest,
octest
).
The bundle extension 'app' is not supported.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
** RUN-TESTS FAILED: 0 passed, 0 failed, 1 errored, 1 total ** (8136 ms)
Looks like SIMCTL_CHILD_OtestQueryBundlePath="/Users/revolt/Library/Developer/Xcode/DerivedData/AppName-driwkksbyionwffehekxhjtjjqat/Build/Products/Debug-iphonesimulator/AppName.app/PlugIns/TestsSchemeName.app"
is causing issues.
Can you come up with a sample project where you see the same error?
Can you also try with another scheme?
The scheme must be the one of the Unit Tests project target, right?
Do you have a separate scheme for tests? I usually use the same scheme for app debugging and testing.
Uhm, yes, I think it created it automatically. I have no previous experience with testing an iOS app.
Found the answer to the tests scheme: https://stackoverflow.com/questions/7922812/xcode-4-why-do-unit-tests-need-their-own-separate-scheme
I had the WRAPPER_EXTENSION
build setting set to app
instead of xctest
, but now it fails with:
Failed to query the list of test cases in the test bundle: Test bundle not found at: /Users/revolt/Library/Developer/Xcode/DerivedData/AppName-driwkksbyionwffehekxhjtjjqat/Build/Products/Debug-iphonesimulator/AppName.app/PlugIns/AppName Tests.xctest
I am using Quick
and Nimble
for tests.
I literally changed nothing, and it worked after running it again. Thanks for your help!
Before you can use xctool to run test, you need to build with xcodebuild or Xcode. It worked probably because you built it somehow.
Oh, right, didn't know that. I think I did indeed built it in Xcode.
Running
xctool -workspace 'AppName.xcworkspace' -scheme 'TestsSchemeName' -sdk "iphonesimulator" run-tests -parallelize
fails with the error:Is it because I'm using
Quick
?