Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
Description
Plugin version: 2.0.6
Xcode version: 11.3.1
Issue:
I am following the exact same steps to set up unit tests via Xcode plugin but it doesn't work. Throws the error saying:
{{xcodebuild: error: Failed to build workspace MyWorkspace with scheme My-scheme.Reason: The scheme 'My-scheme' is not configured for Running.
It runs perfectly while using xcodebuild test CLI command but I would like to see if it is possible via Plugin to maintain consistency. }}
Setting up a unit test step
Add the XCode build step and this time specify your unit test target (e.g. MyAppTests), configuration (e.g. Debug) and the SDK (e.g. Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/).
Leave all the checkboxes unselected. The SDK needs to be supplied here as the unit tests will only be run when building under the simulator's SDK.
urmil025 There was issue with path. It works fine now but is there any way to generate code coverage report?
xcodebuild -workspace MyProject.xcworkspace -scheme MyProjectTests -destination 'platform=iOS Simulator,name=iPhone 12 Pro' -derivedDataPath DerivedData/ -enableCodeCoverage YES test | /usr/local/bin/xcpretty --report junit --output test-reports/reports.xml && exit ${PIPESTATUS[0]}