Running Tests using Bitrise Test step fails at signing a testTarget
Description of the issue
Have a swift .xcodeproj with a main target and 3 test targets (unit, Pact, UI).
Project builds and unit tests pass locally at 95% coverage.
Running bitriseCLI locally with identical bitrise.yml to the one on Bitrise.io passes all ok.
Pushing code to remote and Bitrise picks it up, builds and reaches the Test
step.
Logs show that it signs the main target ok. It signs the UITesting target ok. It signs Pact Tests unit target ok.
Fails to sign unit tests target!
Environment:
Occurs on Bitrise.io: `9.3.x on macOS 10.3 (High Sierra)
Step: xcode-test@1.18.13
Reproducibility
- 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? : When calling a function to call a remote endpoint in a ViewController lifecycle method (viewDidAppear(_))
The Initial ViewController calls a function with closure in viewDidAppear(_)
. If I remove that and implement a button to manually call that same function, it passes on Bitrise.io!?!?
Log says “Unexpectedly found nil while unwrapping an Optional value” though.
Where?!
Why wouldn’t it hit the same error locally!?
Local reproduction
Cannot reproduce locally!
Build log
https://www.bitrise.io/build/f25a13b67363e770
…
Signing /Users/vagrant/Library/Developer/Xcode/DerivedData/projectName-eqheaaeiffcrougxlxoqlhosgerw/Build/Products/Debug-iphonesimulator/projectName.app/PlugIns/projectNameTests.xctest
Automatic retry reason found in log: Early unexpected exit, operation never finished bootstrapping - no restart will be attempted
isAutomaticRetryOnReason=false, no more retry, stopping the test!
xcode test exit code: 65
xcode test failed, error: exit status 65
Last lines of the Xcode’s build log:
Fatal error: Unexpectedly found nil while unwrapping an Optional value
2018-04-22 20:33:05.825204-0700 projectName[4849:27578] Fatal error: Unexpectedly found nil while unwrapping an Optional value
2018-04-22 20:33:13.572 xcodebuild[4254:25051] Error Domain=IDETestOperationsObserverErrorDomain Code=6 “Early unexpected exit, operation never finished bootstrapping - no restart will be attempted” UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
2018-04-22 20:33:13.572 xcodebuild[4254:25051] Error Domain=IDETestOperationsObserverErrorDomain Code=6 “Early unexpected exit, operation never finished bootstrapping - no restart will be attempted” UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
Generating coverage data…
Testing failed:
Test target projectNameTests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
Test target projectNamePactTests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **