Giter VIP home page Giter VIP logo

steps-xcode-test's Introduction

Xcode Test for iOS

Step changelog

Runs your project's pre-defined Xcode tests on every build.

Description

This Steps runs all those Xcode tests that are included in your project. The Step will work out of the box if your project has test targets and your Workflow has the Deploy to Bitrise.io Step which exports the test results and (code coverage files if needed) to the Test Reports page. This Step does not need any code signing files since the Step deploys only the test results to bitrise.io.

Configuring the Step

If you click into the Step, there are some required input fields whose input must be set in accordance with the Xcode configuration of the project. The Scheme input field must be marked as Shared in Xcode.

Troubleshooting

If the Deploy to Bitrise.io Step is missing from your Workflow, then the Xcode Test for iOS Step will not be able to export the test results on the Test Reports page and you won't be able to view them either. The xcpretty output tool does not support parallel tests. If parallel tests are enabled in your project, go to the Step's xcodebuild log formatting section and set the Log formatter input's value to xcodebuild or xcbeautify. If the Xcode test fails with the error Unable to find a destination matching the provided destination specifier, then check our system reports to see if the requested simulator is on the stack or not. If it is not, then pick a simulator that is on the stack.

Useful links

Related Steps

🧩 Get started

Add this step directly to your workflow in the Bitrise Workflow Editor.

You can also run this step directly with Bitrise CLI.

Examples

Run the default Test Plan or Test Targets associated with a Scheme:

- xcode-test:
    inputs:
    - project_path: ./ios-sample/ios-sample.xcodeproj
    - scheme: ios-sample

Run tests in a specific Test Plan associated with a Scheme:

- xcode-test:
    inputs:
    - project_path: ./ios-sample/ios-sample.xcodeproj
    - scheme: ios-sample
    - test_plan: UITests

Use xcbeautify to beautify xcodebuild logs:

- xcode-test:
    inputs:
    - project_path: ./ios-sample/ios-sample.xcodeproj
    - scheme: ios-sample
    - log_formatter: xcbeautify

Run tests with custom xcconfig content:

- xcode-test:
    inputs:
    - project_path: ./ios-sample/ios-sample.xcodeproj
    - scheme: ios-sample
    - xcconfig_content: |
        CODE_SIGN_IDENTITY = Apple Development

Run tests with custom xcconfig file path:

- xcode-test:
    inputs:
    - project_path: ./ios-sample/ios-sample.xcodeproj
    - scheme: ios-sample
    - xcconfig_content: ./ios-sample/ios-sample/Configurations/Dev.xcconfig

⚙️ Configuration

Inputs
Key Description Flags Default
project_path Xcode Project (.xcodeproj) or Workspace (.xcworkspace) path. The input value sets xcodebuild's -project or -workspace option. If this is a Swift package, this should be the path to the Package.swift file. required $BITRISE_PROJECT_PATH
scheme Xcode Scheme name. The input value sets xcodebuild's -scheme option. required $BITRISE_SCHEME
destination Destination specifier describes the device to use as a destination. The input value sets xcodebuild's -destination option. In a CI environment, a Simulator device called Bitrise iOS default is already created. It is a compatible device with the selected Simulator runtime, pre-warmed for better performance. If a device with this name is not found (e.g. in a local dev environment), the first matching device will be selected. required platform=iOS Simulator,name=Bitrise iOS default,OS=latest
test_plan Run tests in a specific Test Plan associated with the Scheme. Leave this input empty to run the default Test Plan or Test Targets associated with the Scheme. The input value sets xcodebuild's -testPlan option.
test_repetition_mode Determines how the tests will repeat. Available options: - none: Tests will never repeat. - until_failure: Tests will repeat until failure or up to maximum repetitions. - retry_on_failure: Only failed tests will repeat up to maximum repetitions. - up_until_maximum_repetitions: Tests will repeat up until maximum repetitions. The input value together with Maximum Test Repetitions (maximum_test_repetitions) input sets xcodebuild's -run-tests-until-failure / -retry-tests-on-failure or -test-iterations option. none
maximum_test_repetitions The maximum number of times a test repeats based on the Test Repetition Mode (test_repetition_mode). Should be more than 1 if the Test Repetition Mode is other than none. The input value sets xcodebuild's -test-iterations option. required 3
relaunch_tests_for_each_repetition If this input is set, tests will launch in a new process for each repetition. By default, tests launch in the same process for each repetition. The input value sets xcodebuild's -test-repetition-relaunch-enabled option. no
should_retry_test_on_fail If this input is set, the Step will rerun the tests in the case of failed tests. Note that all the tests will be rerun, not just the ones that failed. This input is not available if you are using Xcode 13+. In that case, we recommend using the retry_on_failure Test Repetition Mode (test_repetition_mode). required no
xcconfig_content Build settings to override the project's build settings, using xcodebuild's -xcconfig option. You can't define -xcconfig option in Additional options for the xcodebuild command if this input is set. If empty, no setting is changed. When set it can be either: 1. Existing .xcconfig file path. Example: ./ios-sample/ios-sample/Configurations/Dev.xcconfig 2. The contents of a newly created temporary .xcconfig file. (This is the default.) Build settings must be separated by newline character (\n). Example: COMPILER_INDEX_STORE_ENABLE = NO ONLY_ACTIVE_ARCH[config=Debug][sdk=*][arch=*] = YES COMPILER_INDEX_STORE_ENABLE = NO
perform_clean_action If this input is set, clean xcodebuild action will be performed besides the test action. required no
xcodebuild_options Additional options to be added to the executed xcodebuild command. Prefer using Build settings (xcconfig) input for specifying -xcconfig option. You can't use both.
log_formatter Defines how xcodebuild command's log is formatted. Available options: - xcbeautify: The xcodebuild command's output will be beautified by xcbeautify. - xcodebuild: Only the last 20 lines of raw xcodebuild output will be visible in the build log. - xcpretty: The xcodebuild command's output will be prettified by xcpretty. The raw xcodebuild log will be exported in all cases. required xcbeautify
xcbeautify_options Additional options to be added to the executed xcbeautify command.
xcpretty_options Additional options to be added to the executed xcpretty command. --color --report html --output "${BITRISE_DEPLOY_DIR}/xcode-test-results-${BITRISE_SCHEME}.html"
cache_level Defines what cache content should be automatically collected. Use key-based caching instead for better performance. Available options: - none: Disable collecting cache content. - swift_packages: Collect Swift PM packages added to the Xcode project. With key-based caching, you only need the Restore SPM cache and the Save SPM cache Steps to cache your Swift packages. See devcenter for more information. none
verbose_log If this input is set, the Step will print additional logs for debugging. no
collect_simulator_diagnostics If this input is set, the simulator verbose logging will be enabled and the simulator diagnostics log will be exported. never
headless_mode In headless mode the simulator is not launched in the foreground. If this input is set, the simulator will not be visible but tests (even the screenshots) will run just like if you run a simulator in foreground. yes
Outputs
Environment Variable Description
BITRISE_XCODE_TEST_RESULT Result of the tests. 'succeeded' or 'failed'.
BITRISE_XCRESULT_PATH The path of the generated .xcresult.
BITRISE_XCRESULT_ZIP_PATH The path of the zipped .xcresult.
BITRISE_XCODE_TEST_ATTACHMENTS_PATH This is the path of the test attachments zip.
BITRISE_XCODEBUILD_BUILD_LOG_PATH If single_build is set to false, the step runs xcodebuild build before the test, and exports the raw xcodebuild log.
BITRISE_XCODEBUILD_TEST_LOG_PATH The step exports the xcodebuild test command output log.

🙋 Contributing

We welcome pull requests and issues against this repository.

For pull requests, work on your changes in a forked repository and use the Bitrise CLI to run step tests locally.

Learn more about developing steps:

steps-xcode-test's People

Contributors

banyikanna avatar bazscsa avatar bclausdorff avatar bence1001 avatar birmacher avatar birmacherakos avatar bitrise-coresteps-bot avatar buju77 avatar danicsorba avatar godrei avatar istvankovacs-bitrise avatar kdobmayer avatar ktamas avatar kylefleming avatar lpusok avatar lszucs avatar matrangam avatar ofalvai avatar ollitapa avatar omarzl avatar ranunez avatar renovate[bot] avatar russellbstephens avatar szokezsolt avatar tothszabi avatar trapacska avatar viktorbenei avatar zoltan-baba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

steps-xcode-test's Issues

Xcode Test step fails when starting tests

Does not repro locally on matching Xcode and macOS versions
Xcode 9 (9A235)
macOS 10.12.6 (16G29)

seems like simulators aren't booting in time for tests or something. Reached out to support but logging here as well.

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
If you can't find the reason of the error in the log, please check the raw-xcodebuild-output.log

xcode test failed, error: exit status 65

our tests are just Xcode's examples, which have nothing and pass (at least that's what the logs show below).

Could it be related to https://github.com/bitrise-io/bitrise.io/issues/5 ?

=================== LOG BELOW ==============

Test Suite ReadScriptureTests.xctest started
ReadScriptureTests
✓ testExample (0.000 seconds)
◷ testPerformanceExample measured (0.000 seconds)
✓ testPerformanceExample (0.411 seconds)
Executed 2 tests, with 0 failures (0 unexpected) in 0.412 (0.414) seconds
xcode test exit code: 65
xcode test failed, error: exit status 65
exit status 1
ERRO[19:21:15] Step (Xcode: Unit Test) failed, error: (exit status 1)
| |
+----+--------------------------------------------------------------+----------+
| 🚫 | Xcode: Unit Test (exit code: 1) | 169 sec |
+----+--------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-xcode-test/issues |
| Source: https://github.com/bitrise-io/steps-xcode-test |
+----+--------------------------------------------------------------+----------+

Linker issue: symbol(s) not found for architecture x86_64

Hello!

For specific libraries this error occurs when using xcode-test on Bitrise CLI @Xcode11. It's a hit or miss with different libs. Libs that caused this error are:

Error message:

❌  ld: symbol(s) not found for architecture x86_64
❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  • When building locally everything works as expected.
  • When connecting remotely to the CI machine, opening xcode from there and building/testing/archiving the version everything works as expected.

The only place where this issue happens is the actual step xcode-test via Bitrise CLI. I've checked Catalina as well as Mojave for Xcode 11. Same issue. When I remove the libs, the issue's instantly gone.

Is this something that you can address? If it can be build locally I see no reason for it to not work on the Bitrise CLI.

failed to get simulator udid

Running the Xcode-test step version 2.4.2 starting failing with no changes to our bitrise.yml. I'm trying to run an XCUITest target. Below is the output

Failed to download step.zip: Failed to download target from: https://bitrise-steplib-collection.s3.amazonaws.com/step-archives/xcode-test/2.4.2/step.zip
+------------------------------------------------------------------------------+

| (1) xcode-test                                                               |
+------------------------------------------------------------------------------+
| id: xcode-test                                                               |
| version: 2.4.2                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2019-11-08T16:00:49Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
INFO[16:00:49]  * [OK] Step dependency (xcode) installed, available. 
INFO[16:00:49]  * [OK] Step dependency (go) installed, available. 
Configs:
- ProjectPath: affirm/Affirm.xcodeproj
- Scheme: XCUITests-Sandbox
- SimulatorPlatform: iOS Simulator
- SimulatorDevice: iPhone 11 Pro
- SimulatorOsVersion: 13.1
- OutputTool: xcodebuild
- IsCleanBuild: false
- IsSingleBuild: true
- ShouldBuildBeforeTest: true
- ShouldRetryTestOnFail: false
- GenerateCodeCoverageFiles: false
- ExportUITestArtifacts: true
- DisableIndexWhileBuilding: true
- TestOptions: -parallel-testing-enabled NO -maximum-parallel-testing-workers 1
- XcprettyTestOptions: --color --report html --output "/Users/vagrant/deploy/xcode-test-results-.html"
- Verbose: false
- HeadlessMode: false
- CacheLevel: swift_packages
* action: -project
- xcodebuildVersion: Xcode 11.1 (Build version 11A1027)
Export UITest Artifacts (export_uitest_artifacts) turned on, but Xcode version >= 11. The test result bundle structure changed in Xcode 11 it does not contain TestSummaries.plist and Attachments directly, nothing to export.
Checking if output tool (xcpretty) is installed
- xcprettyVersion: 0.3.0
failed to get simulator udid, error: %!(EXTRA *errors.errorString=no simulators found for os version: 13.1)
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | xcode-test (exit code: 1)                                     | 17.46 sec|
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-steplib/steps-xcode-test/issues    |
| Source: https://github.com/bitrise-steplib/steps-xcode-test                  |
+---+---------------------------------------------------------------+----------+

If I change the simulator OS version from 13.1 to latest in the Xcode Test for iOS step, then the tests run successfully, using versoin 13.1 anyway

Failed to update screenshot names - syntax error

Hey there,

I'm encountering the following error:
Failed to update screenshot names, error: failed to parse TestSummaries.plist, error: plist: error parsing XML property list: XML syntax error on line 6031: illegal character code U+0008 xcode test exit code: 65 xcode test failed, error: exit status 65

Is there something wrong in my tests or else?

Thank you

Xcode UI tests failing because of "Lost connection to test manager service"

With the following log (just the end) :

15:24:21.900 XCTRunner[7229:25382] -[AuthenticationUITests testChangeUsernameWillNotShowErrors] started activity <XCActivityRecord: 0x7fb98c964810> 2016-09-11 13:24:21 +0000: Synthesize event
15:24:21.901 testmanagerd[4718:20476] -[XCTestManager allowUITestControlForPID:] 7229 vs 7229
15:24:21.901 testmanagerd[4718:20476] Getting screenshot
15:24:21.944 testmanagerd[4718:20476] systemUIOrientation <AXUIElement 0x7f97d9d253d0> {pid=0}[kAXSpringBoardApplication]: 0 <AXUIElement 0x7f97d9ff8730> {pid=3148}
15:24:21.944 testmanagerd[4718:20476] systemUIOrientation <AXUIElement 0x7f97d9ff8730> {pid=3148}[kAXApplicationOrientationAttribute]: 0 1
15:24:21.945 testmanagerd[4718:20476] Got screenshot, rotating to system UI orientation 1
15:24:21.945 testmanagerd[4718:20476] systemUIOrientation <AXUIElement 0x7f97d9d253d0> {pid=0}[kAXSpringBoardApplication]: 0 <AXUIElement 0x7f97d9e00df0> {pid=3148}
15:24:21.945 testmanagerd[4718:20476] systemUIOrientation <AXUIElement 0x7f97d9e00df0> {pid=3148}[kAXApplicationOrientationAttribute]: 0 1
15:24:21.968 testmanagerd[4718:20476] Replying with data 0x7f97d9e00df0 (113745 bytes), error (null)
15:24:21.969 testmanagerd[4718:20476] -[XCTestManager allowUITestControlForPID:] 7229 vs 7229
15:24:21.969 testmanagerd[4718:20476] Typing ������������������
15:24:21.972 testmanagerd[4718:25546] Key event '�' sent.
15:24:22.017 XCTRunner[7229:25554] Got AX notification 4002
15:24:21.987 testmanagerd[4718:20381] AX Notification 1001
15:24:21.988 testmanagerd[4718:20381] AX Notification 1001
15:24:21.988 testmanagerd[4718:20381] AX Notification 1001
15:24:21.988 testmanagerd[4718:20381] AX Notification 1001
15:24:22.016 testmanagerd[4718:20381] AX Notification 1005
15:24:22.017 testmanagerd[4718:20381] AX Notification 1001
15:24:22.017 testmanagerd[4718:20381] AX Notification 1001
15:24:22.017 testmanagerd[4718:20381] AX Notification 4002
15:24:22.018 testmanagerd[4718:20381] Got user testing notification with payload {
    ModifiedInput = "\b";
    ModifierFlags = 0;
    UnmodifiedInput = "\b";
    event = KeyEventComplete;
}
15:24:22.018 testmanagerd[4718:20381] Key event '�' completed after 0.0493s.
15:24:22.021 testmanagerd[4718:20381] AX Notification 1001
15:24:22.056 XCTRunner[7229:25554] Got AX notification 4002
15:24:22.074 XCTRunner[7229:25554] Got AX notification 4002
15:24:22.035 testmanagerd[4718:25694] Key event '�' sent.
15:24:22.055 testmanagerd[4718:20381] AX Notification 1005
15:24:22.055 testmanagerd[4718:20381] AX Notification 1001
15:24:22.055 testmanagerd[4718:20381] AX Notification 4002
15:24:22.056 testmanagerd[4718:20381] Got user testing notification with payload {
    ModifiedInput = "\b";
    ModifierFlags = 0;
    UnmodifiedInput = "\b";
    event = KeyEventComplete;
}
15:24:22.057 testmanagerd[4718:20381] Key event '�' completed after 0.0383s.
15:24:22.057 testmanagerd[4718:20381] AX Notification 1001
15:24:22.072 testmanagerd[4718:20381] AX Notification 1005
15:24:22.073 testmanagerd[4718:20381] AX Notification 1001
15:24:22.074 testmanagerd[4718:20381] AX Notification 4002
15:24:22.105 XCTRunner[7229:25398] Connection to testmanagerd interrupted.
15:24:22.075 testmanagerd[4718:20381] Got user testing notification with payload {
    ModifiedInput = "\b";
    ModifierFlags = 0;
    UnmodifiedInput = "\b";
    event = KeyEventComplete;
}
15:24:22.122 xcodebuild[4550:20143] Test operation failure: Lost connection to test manager service.
15:24:22.123 xcodebuild[4550:20143] _finishWithError:Error Domain=IDETestOperationsObserverErrorDomain Code=4 "Lost connection to test manager service." UserInfo={NSLocalizedDescription=Lost connection to test manager service.} didCancel: 1
15:24:22.169 xcodebuild[4550:25107] 6740E3BD-D0C3-49B1-87D4-4FCF7F342356: Registered for sim device notification, got token 12
15:24:22.169 xcodebuild[4550:25107] 6740E3BD-D0C3-49B1-87D4-4FCF7F342356: Unregistering for sim device notification with token 12
15:24:22.169 xcodebuild[4550:25107] Sim iPhone 6s is booted (state = 3)
15:24:22.169 xcodebuild[4550:25107] Calling -[SimDevice getenv:error:] for TESTMANAGERD_SIM_SOCK
15:24:22.186 xcodebuild[4550:25107] Returning /private/tmp/com.apple.launchd.aPHQ9lapYk/com.apple.testmanagerd.unix-domain.socket for TESTMANAGERD_SIM_SOCK
15:24:22.186 xcodebuild[4550:25107] Sim iPhone 6s has testmanagerd socket at /private/tmp/com.apple.launchd.aPHQ9lapYk/com.apple.testmanagerd.unix-domain.socket
15:24:22.186 xcodebuild[4550:25107] Connected to testmanagerd socket for Sim iPhone 6s

I dont have such problems in local. The ratio of builds failing becausel of a test failing is more or less between 10 or 20%. It's the first time I track down the problem to the origin using logs exported.

Support OS X projects

Maybe this is out of scope, but OS X projects don't build properly since "-device" is always passed to xcodebuild, which does not make sense for an OS X project.

[email protected] (exit code 1)

My build URL: https://app.bitrise.io/build/0fc3672f3c64f79c
The error message is:
failed to get simulator udid, error: %!(EXTRA *errors.errorString=failed to get latest os version, error: failed to find latest os version for (iOS) - (iPhone 6))
Why are default options failing?
I've wasted 10+ builds trying to get the default build to work...
I'm using Mac OS 10.14, Xcode 10.2.x stack with xcode-test 2.2.0.
I have 0 issues running tests from local machine. It seems to be an environment issue on the Mac OS VM's end.

Copy of screenshots in Xcode 10 seems to be failing

When I get a test failure, which triggers copying of screenshots, I get this error in my log:

Exporting attachments
Failed to export UI test artifacts, error no test attachments found at: /Users/vagrant/Library/Developer/Xcode/DerivedData/LogicPuzzles-gewhzekhsopbesfofqckztpeajlv/Logs/Test/Attachments
xcode test exit code: 65

Digging around a bit on my local machine, it seems the screenshots generated by Xcode (against a physical device) are being generated into here:

/Users/mikemee/Library/Developer/Xcode/DerivedData/LogicPuzzles-chwfavjcvixfrmglqiyrkkxrorxb/Logs/Test/Test-LogicPuzzles-2018.09.19_21-26-52-+0800.xcresult/1_Test/Attachments

When I ran it on a simulator, I found it in this folder (i.e. the same except the timestamp in the directory name):

/Users/mikemee/Library/Developer/Xcode/DerivedData/LogicPuzzles-chwfavjcvixfrmglqiyrkkxrorxb/Logs/Test/Test-LogicPuzzles-2018.09.19_21-37-49-+0800.xcresult/1_Test/Attachments

I'm guessing this new location is needed because multiple simulators may run at the same time.

Hopefully you're aware of this and working on it, but if not... here it is!

isAutomaticRetryOnReason hardcoded to true

Currently there is no option to disable the auto retry on this step (isAutomaticRetryOnReason), doubling the build time for failing builds. A toggle would be appreciated.

Implement a re-try for iOS 9 simulator - UI tests

Similar to the existing "boot timeout" issue.

iOS 9 simulator sometimes fail to prepare for UI tests if the simulator is not yet booted.

With our Xcode 7 sample the logs look like this:

Touch /Users/vagrant/Library/Developer/Xcode/DerivedData/BitriseXcode7Sample-adkzkiqwlfliqgcggdmlvbmsomkl/Build/Products/Debug-iphonesimulator/BitriseXcode7SampleUITests-Runner.app/PlugIns/BitriseXcode7SampleUITests.xctest
    cd /Users/vagrant/git
    export PATH="/Applications/Xcodes/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcodes/Xcode-beta.app/Contents/Developer/usr/bin:/Users/vagrant/.rvm/gems/ruby-2.1.5/bin:/Users/vagrant/.rvm/gems/ruby-2.1.5@global/bin:/Users/vagrant/.rvm/rubies/ruby-2.1.5/bin:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/go/libexec/bin:/Users/vagrant/go/bin:/Users/vagrant/bitrise/tools/cmd-bridge/bin/osx:/Users/vagrant/.rvm/bin:/Users/vagrant/.rvm/bin"
    /usr/bin/touch -c /Users/vagrant/Library/Developer/Xcode/DerivedData/BitriseXcode7Sample-adkzkiqwlfliqgcggdmlvbmsomkl/Build/Products/Debug-iphonesimulator/BitriseXcode7SampleUITests-Runner.app/PlugIns/BitriseXcode7SampleUITests.xctest
2015-09-17 04:11:40.366 xcodebuild[924:5258] [MT] IDETestOperationsObserverDebug: (C96AB9F2-D4B7-43D1-BDDB-793AA2E0C473) Beginning test session with Xcode 7A192o on target  {
        SimDevice: SimDevice : iPhone 6 (058C71C4-46CB-4878-930E-6A0E8707B917) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPhone-6 } runtime={ SimRuntime : 9.0 (13A4325c) - com.apple.CoreSimulator.SimRuntime.iOS-9-0 }
} (9.0 (13A4325c))
** TEST FAILED **
Test Suite 'All tests' started at 2015-09-17 04:11:25.924
Test Suite 'BitriseXcode7SampleTests.xctest' started at 2015-09-17 04:11:25.927
Test Suite 'BitriseXcode7SampleTests' started at 2015-09-17 04:11:25.945
Test Case '-[BitriseXcode7SampleTests.BitriseXcode7SampleTests testExample]' started.
Test Case '-[BitriseXcode7SampleTests.BitriseXcode7SampleTests testExample]' passed (0.004 seconds).
Test Case '-[BitriseXcode7SampleTests.BitriseXcode7SampleTests testPerformanceExample]' started.
/Users/vagrant/git/BitriseXcode7SampleTests/BitriseXcode7SampleTests.swift:33: Test Case '-[BitriseXcode7SampleTests.BitriseXcode7SampleTests testPerformanceExample]' measured [Time, seconds] average: 0.000, relative standard deviation: 197.924%, values: [0.000012, 0.000001, 0.000001, 0.000000, 0.000000, 0.000001, 0.000001, 0.000001, 0.000001, 0.000000], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BitriseXcode7SampleTests.BitriseXcode7SampleTests testPerformanceExample]' passed (0.476 seconds).
Test Suite 'BitriseXcode7SampleTests' passed at 2015-09-17 04:11:26.433.
     Executed 2 tests, with 0 failures (0 unexpected) in 0.480 (0.488) seconds
Test Suite 'BitriseXcode7SampleTests.xctest' passed at 2015-09-17 04:11:26.434.
     Executed 2 tests, with 0 failures (0 unexpected) in 0.480 (0.507) seconds
Test Suite 'All tests' passed at 2015-09-17 04:11:26.436.
     Executed 2 tests, with 0 failures (0 unexpected) in 0.480 (0.512) seconds
2015-09-17 04:11:28.826 XCTRunner[1074:6537] Running tests...
2015-09-17 04:11:28.828 XCTRunner[1074:6537] Looking for test bundles in /Users/vagrant/Library/Developer/CoreSimulator/Devices/058C71C4-46CB-4878-930E-6A0E8707B917/data/Containers/Bundle/Application/05469575-8790-4EFD-B7D5-00F4A983F5B1/BitriseXcode7SampleUITests-Runner.app/PlugIns
2015-09-17 04:11:28.832 XCTRunner[1074:6537] Found test bundle at /Users/vagrant/Library/Developer/CoreSimulator/Devices/058C71C4-46CB-4878-930E-6A0E8707B917/data/Containers/Bundle/Application/05469575-8790-4EFD-B7D5-00F4A983F5B1/BitriseXcode7SampleUITests-Runner.app/PlugIns/BitriseXcode7SampleUITests.xctest
2015-09-17 04:11:28.832 XCTRunner[1074:6537] Looking for configurations in /Users/vagrant/Library/Developer/CoreSimulator/Devices/058C71C4-46CB-4878-930E-6A0E8707B917/data/Containers/Bundle/Application/05469575-8790-4EFD-B7D5-00F4A983F5B1/BitriseXcode7SampleUITests-Runner.app/PlugIns/BitriseXcode7SampleUITests.xctest
2015-09-17 04:11:28.835 XCTRunner[1074:6537] Found configuration 
                      testBundleURL:file:///Users/vagrant/Library/Developer/Xcode/DerivedData/BitriseXcode7Sample-adkzkiqwlfliqgcggdmlvbmsomkl/Build/Products/Debug-iphonesimulator/BitriseXcode7SampleUITests-Runner.app/PlugIns/BitriseXcode7SampleUITests.xctest
                  productModuleName:BitriseXcode7SampleUITests
                        testsToSkip:(null)
                         testsToRun:(null)
                 reportResultsToIDE:YES
                  sessionIdentifier:<__NSConcreteUUID 0x7ff562d98170> 854AAD31-BAE6-451E-935B-1B71B15170C5
         pathToXcodeReportingSocket:(null)
          disablePerformanceMetrics:no
    treatMissingBaselinesAsFailures:no
                    baselineFileURL:(null)
              targetApplicationPath:/Users/vagrant/Library/Developer/Xcode/DerivedData/BitriseXcode7Sample-adkzkiqwlfliqgcggdmlvbmsomkl/Build/Products/Debug-iphonesimulator/BitriseXcode7Sample.app
          targetApplicationBundleID:com.bitrise.BitriseXcode7Sample
                   reportActivities:no
Test Suite 'All tests' started at 2015-09-17 04:11:29.075
Test Suite 'BitriseXcode7SampleUITests.xctest' started at 2015-09-17 04:11:29.077
Test Suite 'BitriseXcode7SampleUITests' started at 2015-09-17 04:11:29.078
Test Case '-[BitriseXcode7SampleUITests.BitriseXcode7SampleUITests testAddAnItemGoToDetailsThenDeleteIt]' started.
    t =     0.00s     Start Test
    t =     0.00s     Set Up
    t =     0.02s         Launch com.bitrise.BitriseXcode7Sample
    t =     2.58s             Assertion Failure: UI Testing Failure - Failed to receive completion for 
/Users/vagrant/git/BitriseXcode7SampleUITests/BitriseXcode7SampleUITests.swift:21: error: -[BitriseXcode7SampleUITests.BitriseXcode7SampleUITests testAddAnItemGoToDetailsThenDeleteIt] : UI Testing Failure - Failed to receive completion for 
2015-09-17 04:11:31.709 XCTRunner[1074:6537] *** Terminating app due to uncaught exception '_XCTestCaseInterruptionException', reason: 'Interrupting test'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010f9069b5 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010f37edeb objc_exception_throw + 48
    2   CoreFoundation                      0x000000010f9068ed +[NSException raise:format:] + 205
    3   XCTest                              0x000000010ee418b9 -[XCTestCase _dequeueFailures] + 560
    4   XCTest                              0x000000010ee41b95 -[XCTestCase _enqueueFailureWithDescription:inFile:atLine:expected:] + 576
    5   XCTest                              0x000000010ee49340 _XCTFailureHandler + 1112
    6   XCTest                              0x000000010ee40d39 _XCTFailInCurrentTest + 512
    7   XCTest                              0x000000010ee5e663 -[XCUIDevice _dispatchEventWithPage:usage:duration:] + 790
    8   XCTest                              0x000000010ee4f7f8 -[XCAXClient_iOS init] + 153
    9   XCTest                              0x000000010ee4f756 __30+[XCAXClient_iOS sharedClient]_block_invoke + 24
    10  libdispatch.dylib                   0x0000000111b404c7 _dispatch_client_callout + 8
    11  libdispatch.dylib                   0x0000000111b2dd2f dispatch_once_f + 76
    12  XCTest                              0x000000010ee4f73c +[XCAXClient_iOS sharedClient] + 42
    13  XCTest                              0x000000010ee5fbe6 __37-[XCUIApplication _launchUsingXcode:]_block_invoke + 50
    14  XCTest                              0x000000010ee45443 -[XCTestCase startActivityWithTitle:block:] + 305
    15  XCTest                              0x000000010ee5fba5 -[XCUIApplication _launchUsingXcode:] + 309
    16  BitriseXcode7SampleUITests          0x000000011b0eedd9 _TFC26BitriseXcode7SampleUITests26BitriseXcode7SampleUITests5setUpfS0_FT_T_ + 153
    17  BitriseXcode7SampleUITests          0x000000011b0eee62 _TToFC26BitriseXcode7SampleUITests26BitriseXcode7SampleUITests5setUpfS0_FT_T_ + 34
    18  XCTest                              0x000000010ee45443 -[XCTestCase startActivityWithTitle:block:] + 305
    19  XCTest                              0x000000010ee41def __24-[XCTestCase invokeTest]_block_invoke_2 + 118
    20  XCTest                              0x000000010ee714a0 -[XCTestContext performInScope:] + 184
    21  XCTest                              0x000000010ee41d68 -[XCTestCase invokeTest] + 169
    22  XCTest                              0x000000010ee42203 -[XCTestCase performTest:] + 443
    23  XCTest                              0x000000010ee3fec9 -[XCTestSuite performTest:] + 377
    24  XCTest                              0x000000010ee3fec9 -[XCTestSuite performTest:] + 377
    25  XCTest                              0x000000010ee3fec9 -[XCTestSuite performTest:] + 377
    26  XCTest                              0x000000010ee2d6d2 __25-[XCTestDriver _runSuite]_block_invoke + 51
    27  XCTest                              0x000000010ee4d8db -[XCTestObservationCenter _observeTestExecutionForBlock:] + 615
    28  XCTest                              0x000000010ee2d61e -[XCTestDriver _runSuite] + 408
    29  XCTest                              0x000000010ee2e37d -[XCTestDriver _checkForTestManager] + 263
    30  XCTest                              0x000000010ee72801 _XCTestMain + 628
    31  libdispatch.dylib                   0x0000000111b24ea9 _dispatch_call_block_and_release + 12
    32  libdispatch.dylib                   0x0000000111b404c7 _dispatch_client_callout + 8
    33  libdispatch.dylib                   0x0000000111b2b07d _dispatch_main_queue_callback_4CF + 714
    34  CoreFoundation                      0x000000010f866e69 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    35  CoreFoundation                      0x000000010f8283b9 __CFRunLoopRun + 2073
    36  CoreFoundation                      0x000000010f827918 CFRunLoopRunSpecific + 488
    37  GraphicsServices                    0x000000011136aad2 GSEventRunModal + 161
    38  UIKit                               0x000000010fcb499e UIApplicationMain + 171
    39  XCTRunner                           0x000000010edb86bf XCTRunner + 5823
    40  libdyld.dylib                       0x0000000111b7092d start + 1
    41  ???                                 0x0000000000000005 0x0 + 5
)
libc++abi.dylib: terminating with uncaught exception of type _XCTestCaseInterruptionException
2015-09-17 04:11:42.871 XCTRunner[1079:6930] Running tests...
2015-09-17 04:11:42.876 XCTRunner[1079:6930] Looking for test bundles in /Users/vagrant/Library/Developer/CoreSimulator/Devices/058C71C4-46CB-4878-930E-6A0E8707B917/data/Containers/Bundle/Application/7326BF2E-AA95-4EBC-8564-20FBE0B7B18B/BitriseXcode7SampleUITests-Runner.app/PlugIns
2015-09-17 04:11:42.885 XCTRunner[1079:6930] Found test bundle at /Users/vagrant/Library/Developer/CoreSimulator/Devices/058C71C4-46CB-4878-930E-6A0E8707B917/data/Containers/Bundle/Application/7326BF2E-AA95-4EBC-8564-20FBE0B7B18B/BitriseXcode7SampleUITests-Runner.app/PlugIns/BitriseXcode7SampleUITests.xctest
2015-09-17 04:11:42.888 XCTRunner[1079:6930] Looking for configurations in /Users/vagrant/Library/Developer/CoreSimulator/Devices/058C71C4-46CB-4878-930E-6A0E8707B917/data/Containers/Bundle/Application/7326BF2E-AA95-4EBC-8564-20FBE0B7B18B/BitriseXcode7SampleUITests-Runner.app/PlugIns/BitriseXcode7SampleUITests.xctest
2015-09-17 04:11:42.895 XCTRunner[1079:6930] Found configuration 
                      testBundleURL:file:///Users/vagrant/Library/Developer/Xcode/DerivedData/BitriseXcode7Sample-adkzkiqwlfliqgcggdmlvbmsomkl/Build/Products/Debug-iphonesimulator/BitriseXcode7SampleUITests-Runner.app/PlugIns/BitriseXcode7SampleUITests.xctest/
                  productModuleName:BitriseXcode7SampleUITests
                        testsToSkip:BitriseXcode7SampleUITests/testAddAnItemGoToDetailsThenDeleteIt()
                         testsToRun:(null)
                 reportResultsToIDE:YES
                  sessionIdentifier:<__NSConcreteUUID 0x7f8679d36f00> C96AB9F2-D4B7-43D1-BDDB-793AA2E0C473
         pathToXcodeReportingSocket:(null)
          disablePerformanceMetrics:no
    treatMissingBaselinesAsFailures:no
                    baselineFileURL:(null)
              targetApplicationPath:/Users/vagrant/Library/Developer/Xcode/DerivedData/BitriseXcode7Sample-adkzkiqwlfliqgcggdmlvbmsomkl/Build/Products/Debug-iphonesimulator/BitriseXcode7Sample.app
          targetApplicationBundleID:com.bitrise.BitriseXcode7Sample
                   reportActivities:no
Test Suite 'Selected tests' started at 2015-09-17 04:11:43.135
Test Suite 'BitriseXcode7SampleUITests.xctest' started at 2015-09-17 04:11:43.140
Test Suite 'BitriseXcode7SampleUITests.xctest' passed at 2015-09-17 04:11:43.144.
     Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.004) seconds
Test Suite 'Selected tests' passed at 2015-09-17 04:11:43.152.
     Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.017) seconds
2015/09/17 04:11:43 Failed to run xcode test, error: exit status 65
exit status 1
ERRO[04:11:43] Step (Xcode: Unit Test) failed, error: (exit status 1)

UI Testing Failure - Failed to receive completion for <XCDeviceEvent:0x7ff019cee000 page 12 usage 64 duration 0.01s within 2.5s

In one of our builds, we are consistently facing this issue, here's the complete exception (I have already emailed the log for build id 58d215ed26c05a5a to [email protected]):

    t =     0.03s         Launch <app bundle identifier>
    t =     2.59s             Assertion Failure: UI Testing Failure - Failed to receive completion for 
<test_file_name>:25: error: <test_method_name> : UI Testing Failure - Failed to receive completion for 
2015-10-15 11:47:46.092 XCTRunner[2624:11132] *** Terminating app due to uncaught exception '_XCTestCaseInterruptionException', reason: 'Interrupting test'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010efe2f65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010ea5adeb objc_exception_throw + 48
    2   CoreFoundation                      0x000000010efe2e9d +[NSException raise:format:] + 205
    3   XCTest                              0x000000010e51a0a9 -[XCTestCase _dequeueFailures] + 560
    4   XCTest                              0x000000010e51a385 -[XCTestCase _enqueueFailureWithDescription:inFile:atLine:expected:] + 576
    5   XCTest                              0x000000010e521b30 _XCTFailureHandler + 1112
    6   XCTest                              0x000000010e519529 _XCTFailInCurrentTest + 512
    7   XCTest                              0x000000010e536e53 -[XCUIDevice _dispatchEventWithPage:usage:duration:] + 790
    8   XCTest                              0x000000010e527fe8 -[XCAXClient_iOS init] + 153
    9   XCTest                              0x000000010e527f46 __30+[XCAXClient_iOS sharedClient]_block_invoke + 24
    10  libdispatch.dylib                   0x00000001112ba4a7 _dispatch_client_callout + 8
    11  libdispatch.dylib                   0x00000001112a7c7b dispatch_once_f + 76
    12  XCTest                              0x000000010e527f2c +[XCAXClient_iOS sharedClient] + 42
    13  XCTest                              0x000000010e5383d6 __37-[XCUIApplication _launchUsingXcode:]_block_invoke + 50
    14  XCTest                              0x000000010e51dc33 -[XCTestCase startActivityWithTitle:block:] + 305
    15  XCTest                              0x000000010e538395 -[XCUIApplication _launchUsingXcode:] + 309
    16  mf-ios-appUITests                   0x000000011bc84eaf _TFC17mf_ios_appUITests30<test_class_name>5setUpfS0_FT_T_ + 335
    17  mf-ios-appUITests                   0x000000011bc85232 _TToFC17mf_ios_appUITests30<test_class_name>5setUpfS0_FT_T_ + 34
    18  XCTest                              0x000000010e51dc33 -[XCTestCase startActivityWithTitle:block:] + 305
    19  XCTest                              0x000000010e51a5df __24-[XCTestCase invokeTest]_block_invoke_2 + 118
    20  XCTest                              0x000000010e549c90 -[XCTestContext performInScope:] + 184
    21  XCTest                              0x000000010e51a558 -[XCTestCase invokeTest] + 169
    22  XCTest                              0x000000010e51a9f3 -[XCTestCase performTest:] + 443
    23  XCTest                              0x000000010e5186b9 -[XCTestSuite performTest:] + 377
    24  XCTest                              0x000000010e5186b9 -[XCTestSuite performTest:] + 377
    25  XCTest                              0x000000010e5186b9 -[XCTestSuite performTest:] + 377
    26  XCTest                              0x000000010e505ec2 __25-[XCTestDriver _runSuite]_block_invoke + 51
    27  XCTest                              0x000000010e5260cb -[XCTestObservationCenter _observeTestExecutionForBlock:] + 615
    28  XCTest                              0x000000010e505e0e -[XCTestDriver _runSuite] + 408
    29  XCTest                              0x000000010e506b6d -[XCTestDriver _checkForTestManager] + 263
    30  XCTest                              0x000000010e54aff1 _XCTestMain + 628
    31  libdispatch.dylib                   0x000000011129edf5 _dispatch_call_block_and_release + 12
    32  libdispatch.dylib                   0x00000001112ba4a7 _dispatch_client_callout + 8
    33  libdispatch.dylib                   0x00000001112a4fc9 _dispatch_main_queue_callback_4CF + 714
    34  CoreFoundation                      0x000000010ef433e9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    35  CoreFoundation                      0x000000010ef04939 __CFRunLoopRun + 2073
    36  CoreFoundation                      0x000000010ef03e98 CFRunLoopRunSpecific + 488
    37  GraphicsServices                    0x0000000110ae4ad2 GSEventRunModal + 161
    38  UIKit                               0x000000010f390676 UIApplicationMain + 171
    39  XCTRunner                           0x000000010e48d9f8 XCTRunner + 6648
    40  libdyld.dylib                       0x00000001112ea92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type _XCTestCaseInterruptionException

Need help in pointing to Workspace file

Hello, I have modified our project structure and after that, Xcode test step is no more able to find Workspace file. Basically, we have moved everything inside a folder named ios

Previous settings:

Environment variable Workspace paths resolves to : App.xcworkspace

screen shot 2018-06-24 at 11 26 23 am

screen shot 2018-06-24 at 11 27 30 am

New settings:

  • I have just changed path the workspace as ios/app.xcworkspace.
  • Also I have changed $BITRISE_SOURCE_DIR to $BITRISE_SOURCE_DIR/ios

Xcode test steps fails saying can not file the workspace file

steps-xcode-test hangs

I build my old project on bitrise.io and faced the following issue:
running steps-xcode-test hangs at Touch path_to_my_projectTests.xctest (with xcpretty: Touching my_projectTests.xctest) this cased an aborted build on bitrise.io by timeout.

When i downloaded the project and runned the test from Xcode, i realized that if fails when the first screen appears:
libc++abi.dylib: terminating with uncaught exception of type NSException

The reason of the fail was in my code, however running the test with xcodebuild did not provide any error message, just hangs at Touch path_to_my_projectTests.xctest (with xcpretty: Touching my_project_Tests.xctest).

Since i fixed my code steps-xcode-test works well.

test filed

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:
)
libc++abi.dylib: terminating with uncaught exception of type NSException
2019-03-06 18:42:40.465 xcodebuild[9254:29845] [MT] IDETestOperationsObserverDebug: 54.157 elapsed -- Testing started completed.
2019-03-06 18:42:40.465 xcodebuild[9254:29845] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2019-03-06 18:42:40.465 xcodebuild[9254:29845] [MT] IDETestOperationsObserverDebug: 54.157 sec, +54.157 sec -- end
2019-03-06 18:42:40.466 xcodebuild[9254:29845] 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, NSUnderlyingError=0x7ffc87531b20 {Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Test runner exited before starting test execution." UserInfo={NSLocalizedDescription=Test runner exited before starting test execution., NSLocalizedRecoverySuggestion=If you believe this error represents a bug, please attach the result bundle at /var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/XCUITestOutput351583117/Test.xcresult}}}

version 2.1.0 breaks when exporting artifacts

We have a workflow that uses the Latest version of this step, and when 2.1.0 was released, it started breaking on hosted Bitrise.

The error we were getting was right after the tests run:

�[0m
�[33m▸�[0m �[39;1mTest�[0m Succeeded

�[34;1mExporting attachments�[0m
2019/01/17 05:58:46 lastSubtests [
	{
		"Duration": 0.3519700765609741,
		"TestIdentifier": "AboutViewControllerTest/testHtml()",
		"TestName": "testHtml()",
		"TestObjectClass": "IDESchemeActionTestSummary",
		"TestStatus": "Success",
		"TestSummaryGUID": "DF20B27E-9AE3-4750-8A4B-9ED7B7F33E38"
	},
	{

etc., etc., one per test, and then:

2019/01/17 05:58:46 no activity summaries found for test: map[TestStatus:Success TestSummaryGUID:DF20B27E-9AE3-4750-8A4B-9ED7B7F33E38 Duration:%!s(float64=0.3519700765609741) TestIdentifier:AboutViewControllerTest/testHtml() TestName:testHtml() TestObjectClass:IDESchemeActionTestSummary]
2019/01/17 05:58:46 no activity summaries found for test: map[Duration:%!s(float64=0.03757596015930176) TestIdentifier:AboutViewControllerTest/testViewDidLoadBehaves() TestName:testViewDidLoadBehaves() TestObjectClass:IDESchemeActionTestSummary TestStatus:Success TestSummaryGUID:EC1CDADD-7FC1-400F-A7E2-6045E0820DDA]
2019/01/17 05:58:46 no activity summaries found for test: map[TestStatus:Success TestSummaryGUID:69188250-74A3-40A9-B477-0BF68648621B Duration:%!s(float64=0.01302802562713623) TestIdentifier:AccountCellTest/testOffCall() TestName:testOffCall() TestObjectClass:IDESchemeActionTestSummary]

etc., etc., one per test. Then we'd run Danger with the xcov plugin and it would fail because it couldn't find coverage information.

We reverted to version 2.0.0 and the problem went away.

build for tvOS

For tvOS, we need to set destination as following.

-destination platform=tvOS Simulator,name=Apple TV 1080p,OS=latest

Underlying error: Failed to install the requested application. The application's Info.plist does not contain CFBundleVersion.

Hello guys,

I'm facing to an issue on Bitrise for xcode-test step with Xcode 11 GM 2.

Error Domain=NSPOSIXErrorDomain Code=22 "Invalid argument" UserInfo={bundleURL=file:///Users/vagrant/Library/Developer/Xcode/DerivedData/FinalCAD-Swift-dxawxuidwwedvqdgesklqkhnncjw/Build/Products/Debug-iphonesimulator/FINALCAD.app/, NSLocalizedFailureReason=The application's Info.plist does not contain CFBundleVersion., NSLocalizedRecoverySuggestion=Ensure your bundle contains a CFBundleVersion., NSLocalizedDescription=Failed to install the requested application}

I can't reproduce on my Mac but only on Bitrise and it seems to be related to the new CoreSimulator.framework.

https://developer.apple.com/documentation/xcode_release_notes/xcode_11_beta_release_notes

"Bundles without a CFBundleVersion are invalid and can't be properly installed on devices or simulators. CoreSimulator now checks and rejects such bundles earlier in the process with a clearer error message. (49892531)"

My CFBundleVersion is correctly configured in my Info.plist but the tests always failed on Bitrise with this error message.

It seems to be related to a cache in CoreSimulatorBridge (https://stackoverflow.com/questions/56450295/cannot-run-application-on-simulator-after-installing-xcode-11-cfbundleversion).

I have another workflow for another application with the same steps and I don't have this issue for Xcode 11.

Thanks!

If can't find the required delimited in the output print the full output, even if success

2015/09/24 18:45:49 => Simulator Timeout detected
2015/09/24 18:45:49  [!] isRetryOnTimeout=false, no more retry, stopping the test!
2015/09/24 18:45:49 Exporting: BITRISE_XCODE_TEST_RESULT
2015/09/24 18:45:49  [!] Could not find the required test result delimiter: ** TEST SUCCEEDED **
2015/09/24 18:45:49 Exporting: BITRISE_XCODE_TEST_FULL_RESULTS_TEXT

And the output is not available - impossible to debug.

Xcode UI tests failing with error 65 - DTXProxyChannel error 1.

Using the official Xcode test step I have the following error : DTXProxyChannel error 1

Stack : Xcode 7.3.1, on OS X 10.11.4

Log :

23:55:54.767 xcodebuild[5304:24292] /Users/vagrant/Library/Developer/CoreSimulator/Devices: Received sim device set notification: {
    device = "SimDevice : iPhone 6s (6740E3BD-D0C3-49B1-87D4-4FCF7F342356) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPhone-6s } runtime={ SimRuntime : 9.3 (13E230) - com.apple.CoreSimulator.SimRuntime.iOS-9-3 }";
    "new_state" = 3;
    notification = "device_state";
    "prev_state" = 2;
}
23:55:54.851 xcodebuild[5304:23952] Returning /private/tmp/com.apple.launchd.jHAhr8KIAP/com.apple.testmanagerd.unix-domain.socket for TESTMANAGERD_SIM_SOCK
23:55:54.851 xcodebuild[5304:23952] Sim iPhone 6s has testmanagerd socket at /private/tmp/com.apple.launchd.jHAhr8KIAP/com.apple.testmanagerd.unix-domain.socket
23:55:54.851 xcodebuild[5304:23952] Connected to testmanagerd socket for Sim iPhone 6s
23:55:54.881 xcodebuild[5304:23952] Creating the connection.
23:55:54.914 xcodebuild[5304:23952] Listening for proxy connection request from the test bundle (all platforms)
23:55:54.914 xcodebuild[5304:23952] Resuming the connection.
23:55:54.914 xcodebuild[5304:23952] Test connection requires daemon assistance.
23:55:54.914 xcodebuild[5304:23947] Checking test manager availability..., will wait up to 120s
23:55:54.916 xcodebuild[5304:23947] Starting test session with ID <__NSConcreteUUID 0x7fdf33d87e40> DDE5A45B-88B3-4BBD-85F8-1BB5EBF8742B
23:56:27.730 xcodebuild[5304:24289] Error from testmanagerd: The operation couldn’t be completed. (DTXProxyChannel error 1.) ((null))
23:56:27.730 xcodebuild[5304:23947] Test operation failure: The operation couldn’t be completed. (DTXProxyChannel error 1.)
23:56:27.730 xcodebuild[5304:23947] _finishWithError:Error Domain=IDETestOperationsObserverErrorDomain Code=3 "The operation couldn’t be completed. (DTXProxyChannel error 1.)" UserInfo={NSLocalizedDescription=The operation couldn’t be completed. (DTXProxyChannel error 1.)} didCancel: 1

Note : An Apple engineer suggested on Apple forum to use Xcode 8. Unfortunately I can not try because of swift migration.

Fix outdated Readme

This readme seems generic and does not tell me anything on how to use this step.

Yes, I can check step.yml and try to find the the documentation I'm looking for, but it would be way more user-friendly if it would be listed in the readme 😃. Maybe the readme could be auto-generated from the step.yml?

Sometimes fails with `iPhoneSimulator: Timed out waiting...`

xcodebuild[964:4881]  iPhoneSimulator: Timed out waiting 120 seconds for simulator to boot, current state is 1.

This is a known issue which can happen anywhere, but it happens more frequently in performance limited environment, for example running the Simulator inside a Virtual Machine.

Expose the raw output as a build artifact, at least for failed builds or in a compressed form

tests fail with exit status 65, no diagnostic output

I ended up replacing the step with a simple shell script.

▸ Touching motiTests.xctest
2016/02/10 05:10:41 Exporting: BITRISE_XCODE_TEST_RESULT
2016/02/10 05:10:41 Exporting: BITRISE_XCODE_RAW_TEST_RESULT_TEXT_PATH
2016/02/10 05:10:41 xcode test failed with error: exit status 65
exit status 65
ERRO[05:10:41] Step (Xcode: Unit Test) failed, error: (exit status 1) 

Build command runs twice unnecessarily, doubling build times

Currently the build is being made twice unnecessarily which doubles build time.

First this is run:
xcodebuild "-workspace" "..." "-scheme" "..." "clean" "build" "-destination" "platform=iOS Simulator,name=iPhone 6s,OS=latest"

Which cleans and builds the app (or if clean option is disabled, just builds the app).

Then this is run:
xcodebuild "-workspace" "..." "-scheme" "..." "build" "test" "-destination" "platform=iOS Simulator,name=iPhone 6s,OS=latest"

Which builds the app a second time, for testing. Running with build uses a different config from the scheme than when build test are used together.

The first xcodebuild step can be removed to reduce build times by 50%. Or it should only run with the clean option and not build, if clean build has been enabled.

Exporting UITest Artifacts from Xcode 11

Hey Bitrise,

Was wondering what your plans are for exporting Xcode 11 attachments & screenshots in the Xcode Test step as I saw it noted that this step hasn't been updated for that yet. My company has an open source Swift CLI tool we're installing via Homebrew that does the Xcode 11 extraction & we got a request to make a Bitrise step for the functionality (ChargePoint/xcparse#29). So that's left me with these questions:

  1. Do you have any short term plans of implementing your own extraction for Xcode 11 xcresult?
  2. If not, would you be open to adding a dependency to our Homebrew tap formula in this step to get such an ability?
  3. Or should this Xcode 11 xcresult attachment extraction business be its own Bitrise step separate from Xcode Test as suggested by the enhancement request we got?

Add option to configure derived data directory

Currently a temporary directory for Xcode derived data is generated by the main.go script. However this is not exported as an output variable or configurable as an input option. We have another bitrise step (codecov) that is dependent on using the default derived data location (or you can use the Script step and define the location manually). Since steps-xcode-test does not expose the derived data path it generates we can't manually set this in our codecov step.

The steps-xcode-test step should export out the derived data directory path and/or allow the derived data directory path to be configured manually. This is the only way we can access the generated code coverage files in subsequent steps.

Compilation performed twice

Problem
Calling xcodebuild test ... does trigger a compilation before performing the tests on its own.
Calling xcodebuild build test ... leads to the code being compiled twice before performing the tests. The second compilation might be unnecessary and have a negative impact on the duration.

Proposal

  • Drop the build argument from the command, because the test action does compile the code before testing anyway.

Local experiment
The following observations took place on my computer with the same commandline options (-project, -scheme, -destination) as on bitrise and cleaning before every build. I called xcodebuild from the commandline:

abbreviated command result duration
xcodebuild test ... 1x compilation + 1x test 4:47 min
xcodebuild build test ... 2x compilation + 1x test 6:58 min

All tests were performed without problem calling only xcodebuild test ...

Local config

  • Xcode 7.3.1 + El Capitan

Bitrise Xcode Test Step config

  • Xcode 7.3.1 + El Capitan
  • single_build: true
  • clean_build: false

Extract from the bitrise logfile

...
Building� Project/Project [Debug]
Check Dependencies�
Running script� 'SwiftLint'
Compiling� AddNewViewController.swift
...
Touching� ProjectTests.xctest
Build� Succeeded
Building� Project/Project [Debug]
Check Dependencies�
Running script� 'SwiftLint'
Compiling� AddNewViewController.swift
...
Touching� ProjectTests.xctest
Building� Project/ProjectUITests [Debug]
Check Dependencies�
Processing� Info.plist
Preprocessing� /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/XCTRunner.app/Info.plist
Compiling� UITestCase.swift
Linking� ProjectUITests
Touching� ProjectUITests.xctest
All tests�
Quick.framework�
Test Suite ProjectTests.xctest� started
...

Expose specific reason for build failure

Prior to V2, I used to use "$BITRISE_UNITTEST_STATUS" which would tell me whether unit tests passed or failed. It doesn't appear to be available anymore. When a build fails, I want to know which step caused the build to fail.

I used that status in [email protected] when I report about successful / failing builds.

Early unexpected exit, operation never finished bootstrapping

`Running script '[CP] Copy Pods Resources'
▸ Running script '[CP] Embed Pods Frameworks'
▸ Touching UITests.xctest
▸ Signing /Users/vagrant/Library/Developer/Xcode/DerivedData/Project-gtlsyysavgzqejcwgxuiyrbtqmah/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/UITests-Runner.app/PlugIns/UITests.xctest

xcodebuild[3246:15026] 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}`

Happens quite often only on Bitrise, cannot reproduce it locally with the same xcode and simulator versions.

[Resolved] Xcode Unit Test step fails with exit code 66

Mainly posting this as an FYI to others who might have the same issue. Hopefully this helps save someone else time.

The xcode scheme we use for CI/Production builds had no test target(s) so the test step would fail without any provided reason.

We added our test target to the scheme, pushed to remote and all was good.

Allow backticks to work with XCPretty

Best explanation can be found in this, already closed issue: #119 (comment)

To get the most out of both Fastlane and Bitrise, a requirement is needed to pass in a custom formatter for XCPretty. This, however, requires us to use backticks: `

See the linked issue for more details.

Step does not save log if not using xcpretty

The step apparently doesn't save a log file if you don't use xcpretty and because BITRISE_XCODE_TEST_FULL_RESULTS_TEXT was removed you can't post-process the log output anymore.

Secondly, the step still claims this is a valid environment variable so the text should be updated.

Lastly, it would be really nice if you could get both the raw log and the xcpretty output. Using tee or the go pipe stuff it should be fairly easy to do that.

Background: I'm working on a step to automatically comment on pull requests when a build fails and include the failing test lines from the log. I already have everything working locally, I just can't get the actual log output for processing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.