Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Travis config for Xcode 8.3 and fix test failures #2378

Merged
merged 4 commits into from
Apr 24, 2017

Conversation

liuxuan30
Copy link
Member

@liuxuan30 liuxuan30 commented Apr 20, 2017

update device id in Travis CI and xcode 8.3 image

Rakefile Outdated
@@ -39,8 +39,8 @@ def devices
{
iOS: {
sdk: 'iphonesimulator',
device: "id='22FA2149-1241-469C-BF6D-462D3837DB72'",
uuid: '22FA2149-1241-469C-BF6D-462D3837DB72'
device: "34FA4749-C467-4D45-9F8E-E31AEDDC39C2'",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The id=' is needed here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@liuxuan30
Copy link
Member Author

@petester42 I guess we need to use Xcode 8.3 image as well? What else to we have to modify? I can do it all in one. Just found what you did for Xcode 8.2: 99e9aa0

But I'm not sure if I just change osx_image: xcode8.2 to xcode8.3 is enough? I saw you update xcodeproj as well.

@pmairoldi
Copy link
Collaborator

ya. just change the config to be 8.3

@liuxuan30
Copy link
Member Author

OK, I have changed to 8.3. Let's see if it can pass

@liuxuan30 liuxuan30 changed the title use iPhone 7 10.2 device id in Travis CI Update Xcode 8.3 and device id in Travis CI Apr 20, 2017
2. use Apple TV 1080p (10.2) and iPhone 7 (10.3) device id in Travis CI
@liuxuan30
Copy link
Member Author

▸ Processing Info.plist

▸ Touching ChartsTests.xctest

▸ Signing /Users/travis/Library/Developer/Xcode/DerivedData/Charts-dsitxzqjkujfnvaoreewgudaitlo/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/ChartsTests.xctest

2017-04-20 02:46:56.978 xcodebuild[4087:13500] 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}

Testing failed:

	Test target ChartsTests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)

** TEST FAILED **

I tried on my machine with rake ci[iOS], it has same error code, and I also checked the log:

106 11:00:46.292 xcodebuild[82088:12196011] Tracking pid 82380 for simulator <DVTiPhoneSimulator: 0x7fb8ca6c5d80> {
107         SimDevice: SimDevice : iPhone 7 (1A98B8F5-C2C4-451B-B4C0-4FC506ACC3D6) : state={ Booted } deviceType={ SimDeviceType : com.apple.        CoreSimulator.SimDeviceType.iPhone-7 } runtime={ SimRuntime : 10.3 (14E269) - com.apple.CoreSimulator.SimRuntime.iOS-10-3 }
108 }
109 11:00:46.292 xcodebuild[82088:12196011] Checking to see if pid 82380 is valid: kill(pid, 0) = 0 (YES, it's still running)
110 11:00:46.292 xcodebuild[82088:12196011] Setting up DVTTaskNotifyOnProcDeath for pid 82380
111 11:00:46.292 xcodebuild[82088:12190492] Test process runnable PID is 82380.
112 11:00:46.507 xcodebuild[82088:12190492] Got death notice for pid 82380, removing from SimulatorSessionMap
113 11:00:46.507 xcodebuild[82088:12196014] 1A98B8F5-C2C4-451B-B4C0-4FC506ACC3D6: Executable terminated at path: /Applications/Xcode.app/            Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/xctest (status = 20992)
114 11:00:46.508 xcodebuild[82088:12190492] Test operation failure: Launch session expired before checking in.
115 11:00:46.509 xcodebuild[82088:12190492] _finishWithError:Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Launch session expired        before checking in." UserInfo={NSLocalizedDescription=Launch session expired before checking in.} didCancel: 1   

Any idea? @petester42 I googled but can't find the exact error code solution

@pmairoldi
Copy link
Collaborator

I don't have time right now but I'll look at it maybe tomorrow

@liuxuan30
Copy link
Member Author

Sure. I also tried to manually run

xcodebuild -project 'Charts.xcodeproj' -scheme 'ChartsTests' -configuration 'Debug' -sdk iphonesimulator -destination id='E40B5365-EF82-430D-A767-2A37995CCEE1' clean build test

on my machine, it reports:

  /bin/sh -c /Users/xuanliu/Library/Developer/Xcode/DerivedData/Charts-ambsdrskvocwekcmoobyhanaiixm/Build/Intermediates/CodeCoverage/Intermediates/Charts.build/Debug-iphonesimulator/ChartsTests.build/Script-064DBAE11D93813D002584CD.sh
Depencies have already been built.

2017-04-20 11:53:08.710 xctest[87783:12569635] The bundle “ChartsTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2017-04-20 11:53:08.711 xctest[87783:12569635] (dlopen_preflight(/Users/xuanliu/Library/Developer/Xcode/DerivedData/Charts-ambsdrskvocwekcmoobyhanaiixm/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/ChartsTests.xctest/ChartsTests): Library not loaded: @rpath/FBSnapshotTestCase.framework/FBSnapshotTestCase
  Referenced from: /Users/xuanliu/Library/Developer/Xcode/DerivedData/Charts-ambsdrskvocwekcmoobyhanaiixm/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/ChartsTests.xctest/ChartsTests
  Reason: image not found)
2017-04-20 11:53:08.725 xcodebuild[87517:12565751] 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}
2017-04-20 11:53:08.726 xcodebuild[87517:12567557] Connection peer refused channel request for "dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"; channel canceled <DTXChannel: 0x7fba8660af50>

Testing failed:
	Test target ChartsTests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **

Not sure if it's related. I tried to link the framework in ChartTests build phases, but no luck.

@liuxuan30
Copy link
Member Author

liuxuan30 commented Apr 21, 2017

Today, I just tried to manually copy FBSnapshotTestCase.framework into

/Users/xuanliu/Library/Developer/Xcode/DerivedData/Charts-ambsdrskvocwekcmoobyhanaiixm/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator

xuanliu:Debug-iphonesimulator xuanliu$ ls -l
total 0
drwxr-xr-x  7 xuanliu  staff  238 Apr 21 11:18 Charts.framework
drwxr-xr-x  4 xuanliu  staff  136 Apr 21 11:18 ChartsTests.swiftmodule
drwxr-xr-x  8 xuanliu  staff  272 Apr 21 11:18 ChartsTests.xctest
drwxr-xr-x  8 xuanliu  staff  272 Apr 21 11:16 FBSnapshotTestCase.framework

and just call

xcodebuild -project 'Charts.xcodeproj' -scheme 'ChartsTests' -configuration 'Debug' -sdk iphonesimulator -destination id='E40B5365-EF82-430D-A767-2A37995CCEE1' test

It actually succeeded. Still investigating why it did not copy the framework

@liuxuan30 liuxuan30 force-pushed the travis branch 4 times, most recently from c346d52 to 0191044 Compare April 21, 2017 05:25
@codecov-io
Copy link

codecov-io commented Apr 21, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@aca0491). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2378   +/-   ##
=========================================
  Coverage          ?   19.66%           
=========================================
  Files             ?      112           
  Lines             ?    13710           
  Branches          ?        0           
=========================================
  Hits              ?     2696           
  Misses            ?    11014           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aca0491...8302817. Read the comment docs.

@liuxuan30
Copy link
Member Author

liuxuan30 commented Apr 21, 2017

Finally all green. @petester42 if the new commits of this PR looks good to you, I will merge it.

One shortage is, as $PLATFORM is determined in Travis, when we want to run tests on local machine, we have to manually run export PLATFORM=iOS

We can move $PLATFORM to Rakefile, and later export it again. Sounds not worthy.

Or, we build all schemes in the beginning. But I remember you used to build them all, and you just changed to dynamic building, must be some reasons, like Realm took too long? Since we removed Realm, building two schemes should not take much time.

Let me know what you think.

The run script is referred from Carthage instructions https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos and https://github.com/Carthage/Carthage#adding-frameworks-to-unit-tests-or-a-framework

@liuxuan30 liuxuan30 changed the title Update Xcode 8.3 and device id in Travis CI Update Travis config for Xcode 8.3 and fix test failures Apr 21, 2017
pmairoldi and others added 2 commits April 23, 2017 20:31
update the schemes so test and library are linked (⌘ + U). move coping
dependencies to external script like ChartsRealm
update schemes, move script to file like ChartsRealm
for (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do
VAR=SCRIPT_INPUT_FILE_$n
source=${!VAR}.dSYM
dest=${BUILT_PRODUCTS_DIR}/$(basename "$source")
Copy link
Member Author

@liuxuan30 liuxuan30 Apr 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, @petester42 which dSYM is here? and what's for? carthage copy-framework seems will copy FBSnapshotTestCase.framework.dSYM under CodeCoverage/Products/Debug-iphonesimulator/

@liuxuan30 liuxuan30 merged commit 2ceffe6 into ChartsOrg:master Apr 24, 2017
@liuxuan30 liuxuan30 deleted the travis branch April 24, 2017 02:11
@liuxuan30
Copy link
Member Author

@petester42 sorry to bring this up again, don't know why but I notice travis will compile Charts twice, but on my machine, it seems just once.

Do you think we can change clean build test to just clean test?

PeterSrost pushed a commit to sokol8/Charts that referenced this pull request Oct 31, 2018
Update Travis config for Xcode 8.3 and fix test failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants