Re: Unit testing via SSH in Xcode 6

2015-01-15 Thread Jens Alfke

 I'm having trouble running my unit tests over SSH after upgrading from Xcode 
 4 to Xcode 6.
...
 
 Test target MyCocoaApplicationTests encountered an error (Test session 
 exited(-1) without checking in. If you believe this error represents a bug, 
 please attach the log file at 
 /var/folders/h2/xngxkxm15_93gm4n50p7s_mmgp/T/com.apple.dt.XCTest-status/Session-2015-01-15_12:35:52-0qPMDN.log)

Looks like xcodebuild is trying to launch a GUI process, which fails because 
its process group wasn't created by launchd and so isn't allowed to connect to 
the WindowServer. (You can create the same kind of error by trying to use the 
'open' command from an SSH shell.)

Since you say this worked in Xcode 4, I guess the older test environment must 
not have created a GUI process.

Have you looked at the Xcode continuous-integration support in OS X Server? It 
can run automated tests.

—Jens ___
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list  (Xcode-users@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Unit testing via SSH in Xcode 6

2015-01-15 Thread Jens Alfke

 On Jan 15, 2015, at 12:44 PM, Andrew Keller and...@kellerfarm.com wrote:
 
 Our current build system performs many steps, one of which is kicking off an 
 xcodebuild invocation.  Additional steps are performed with the results.  (In 
 other words, we don't just have an Xcode project with which we click 
 Build.)  Would that be a problem with Apple's CI infrastructure?

I'm not sure; I'm not an expert at it. We've only just started using it.

—Jens ___
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list  (Xcode-users@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Unit testing via SSH in Xcode 6

2015-01-15 Thread Joar Wingfors
HI Andrew,

When a user logs into OS X sufficient context is established to satisfy the 
requirements of GUI apps (or really, the frameworks and services used by GUI 
apps). The context established for a remote SSH connection is different, and on 
its own typically not sufficient for GUI apps. I would expect that you need to 
do two things for this to work reliably:

- The user that is invoking xcodebuild need to be logged in to a GUI / 
Aqua session 
- The invocation of xcodebuild should be implemented as a LaunchAgent 
(not as a LaunchDaemon) 

Some background on this topic can be found here:

Technical Note TN2083, Daemons and Agents
https://developer.apple.com/library/mac/technotes/tn2083/_index.html

(Note that from the change list it appears to not have been updated in a while, 
so it's probably no longer correct in every aspect / detail). 

Like Jens I'd suggest that you take a look at Xcode Server, as it's designed to 
handle the stuff mentioned above on your behalf. Xcode Server also offer 
triggers, providing the hooks that you mentioned you'd need. 

Finally, I'd recommend reviewing the associated WWDC session videos from last 
year:

https://developer.apple.com/videos/wwdc/2014/

Look for Testing in Xcode 6 and Continuous Integration with Xcode 6. 

Joar


 On 15 jan 2015, at 09:40, Andrew Keller and...@kellerfarm.com wrote:
 
 Hello all,
 
 I'm having trouble running my unit tests over SSH after upgrading from Xcode 
 4 to Xcode 6.  My problem appears to be reproducible with a default Xcode 
 project:
 
 1. Using Xcode 6.1.1 (6A2008a)
 2. Create an empty Cocoa application
 3. Run unit tests via an SSH session using: `xcodebuild -scheme 
 MyCocoaApplication test`
 
 Expected behavior: Unit tests behave the same as they do when the same 
 command is ran locally on the machine in a Terminal window with no SSH 
 session.
 
 Found behavior:
 
 $ xcodebuild -scheme MyCocoaApplication test
 === BUILD TARGET MyCocoaApplication OF PROJECT MyCocoaApplication WITH 
 CONFIGURATION Debug ===
 
 Check dependencies
 
 === BUILD TARGET MyCocoaApplicationTests OF PROJECT MyCocoaApplication WITH 
 CONFIGURATION Debug ===
 
 Check dependencies
 
 
 Testing failed:
   
 Test target MyCocoaApplicationTests encountered an error (Test session 
 exited(-1) without checking in. If you believe this error represents a bug, 
 please attach the log file at 
 /var/folders/h2/xngxkxm15_93gm4n50p7s_mmgp/T/com.apple.dt.XCTest-status/Session-2015-01-15_12:35:52-0qPMDN.log)
 ** TEST FAILED **
 
 $ cat 
 /var/folders/h2/xngxkxm15_93gm4n50p7s_mmgp/T/com.apple.dt.XCTest-status/Session-2015-01-15_12:35:52-0qPMDN.log
 2015-01-15 12:35:52.372 Beginning test session with Xcode 6A2008a
 2015-01-15 12:35:52.372 
 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme 
 MyCocoaApplication test
 2015-01-15 12:35:52.372 Testing on device: DVTLocalComputer: 0x7fc76a8b14e0 
 (My Mac | x86_64h)
 2015-01-15 12:35:52.372 Writing testing status log to 
 /var/folders/h2/xngxkxm15_93gm4n50p7s_mmgp/T/com.apple.dt.XCTest-status/Session-2015-01-15_12:35:52-0qPMDN.log.
 2015-01-15 12:35:52.372 Initializing test infrastructure.
 2015-01-15 12:35:52.372 Waiting for connection to unix domain socket.
 2015-01-15 12:35:52.516 Launch session started, setting a 
 disallow-finish-token on the run operation.
 2015-01-15 12:35:53.129 Adding console adaptor for test process.
 2015-01-15 12:35:55.689 Test operation failure: Test session exited(-1) 
 without checking in.
 2015-01-15 12:35:55.689 _finishWithError:Error 
 Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3 Test session 
 exited(-1) without checking in. UserInfo=0x7fc76ade8110 
 {NSLocalizedDescription=Test session exited(-1) without checking in.} 
 didCancel: 1
 
 What am I missing?  How can I run my unit tests via SSH?
 
 Thanks,
  - Andrew Keller
 
 ___
 Do not post admin requests to the list. They will be ignored.
 Xcode-users mailing list  (Xcode-users@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/xcode-users/joar%40joar.com
 
 This email sent to j...@joar.com


 ___
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list  (Xcode-users@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to arch...@mail-archive.com