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

Running Subliminal on Jenkins #40

Closed
nzhuk opened this issue Jul 4, 2013 · 3 comments
Closed

Running Subliminal on Jenkins #40

nzhuk opened this issue Jul 4, 2013 · 3 comments

Comments

@nzhuk
Copy link
Contributor

@nzhuk nzhuk commented Jul 4, 2013

Hi,

I'm using Subliminal with latest release versions of dev tools (Xcode 4.6.3, OS X 10.8.4). I use the following script to launch subliminal-test on CLI:

#!/bin/bash

# Ensure that `subliminal-test` uses the Xcode 4.6 toolchain
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

# Run the tests in the non-retina iPhone Simulator
DEVICE="iPhone"

# Run the tests on iOS 6.1
VERSION=6.1

# Allow `subliminal-test` to work around bugs in Apple's `instruments` tool 
# while running un-attended. See the FAQ for more information.
# PASSWORD="xxxxxx"
# The password is passed on CLI when this script is run

OUTPUT_DIR=reports
mkdir -p "$OUTPUT_DIR"

# Returns 0 on success, 1 on failure
# Log output and screenshots will be placed in $OUTPUT_DIR
"$PROJECT_DIR/IntegrationTests/Subliminal/Supporting Files/CI/subliminal-test" \
    -project "$YOUR_PROJECT" \
    -sim_device "$DEVICE" \
    -sim_version "$VERSION" \
    -login_password "$PASSWORD" \
    -output "$OUTPUT_DIR"

It all works just fine on my local machine's CLI, but when I try to run this script from a Jenkins build phase on a remote Mac, I observe the following scenario:

  • subliminal-test runs
  • iOS Simulator is launched
  • The console outputs the following message (iOS simulator window reappears between these steps, as expected):

Preparing to install app...

Setting simulator device type...
Successfully set simulator device type.

Setting simulator version...
Successfully set simulator version.

Resetting simulator content and settings...
Successfully reset iOS Simulator.

Launching tests...

Then nothing happens for about 10 seconds, and a "Simulator session timed out" alert dialog appears on my remote Mac (I have remote desktop open so I can see what happens). The user which Jenkins is running under has admin privileges, the access for assistive devices is enabled on the remote machine and I've run "DevToolsSecurity --enable" (all tips which are recommended in SO comments on similar issues). Still, no luck.

If I open a Terminal on the remote machine and start subliminal-test myself (logged in as Jenkins user), everything works just fine. So it's only when Jenkins executes this command the simulator times out.

Any tips?

@aegolden
Copy link
Contributor

@aegolden aegolden commented Jul 4, 2013

Is anything interesting appearing in the system log on the remote machine?

@wearhere
Copy link
Contributor

@wearhere wearhere commented Jul 5, 2013

This thread, particularly this reply and this reply, seem like they might have the answer. I can confirm, by executing sudo su and then subliminal-test, that instruments will not launch the app if you are the root user.

@nzhuk
Copy link
Contributor Author

@nzhuk nzhuk commented Jul 5, 2013

Ok, moving Jenkins launchd plist file from LaunchDaemons to LaunchAgents and rebooting the build machine seemed to do the trick. Thanks!

@nzhuk nzhuk closed this Jul 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants