I am trying to get my tests to run in Bitrise. My app is an Xcode-based Swift CLI app, which means if I create a new unit testing bundle target, I cannot select the existing CLI executable as the “target to be tested”. Instead, I have to create the testing bundle with no target, and manually add existing files containing code to be tested as members of the testing bundle target. (This is described here.)
When attempting to use the xcode-test-mac step, it tries to run xcodebuild as follows:
$ set -o pipefail && xcodebuild "-project" "tesspost.xcodeproj" "-scheme" "TessPostTests" "build" "test" "COMPILER_INDEX_STORE_ENABLE=NO" | xcpretty
And I get the errors:
xcodebuild: error: Failed to build project tesspost with scheme TessPostTests. Reason: The scheme 'TessPostTests' is not configured for Running. Recovery suggestion: The scheme 'TessPostTests' has nothing configured to build for Running and has no executable specified to Run. Edit the scheme to configure the Run action.
I think this is expected, and the issue is that xcodebuild is being told to do a
"build" action instead of just a
"test". When I remove
"build" and run xcodebuild locally, it works. Inside of Xcode, there is no issue with running tests, presumably because the target is being Built for Testing and not Built for Running. What can I do to get bitrise to just do tests for this scheme?
Bitrise.io: Xcode 11.3.x, on macOS 10.14.6 (Mojave)
- Does a “Rebuild” help? : NO
- Does a rebuild without caches help? : NO
- Does the issue happen sporadically, or every time? : Every time
- Does upgrading the build Step to the latest version help? : NO
- When did the issue start? :
Same thing happens inside the bitrise CLI