Re: KIF/Jenkins/Waxsim Simulator session timed out

278 views
Skip to first unread message

Duncan Wallace

unread,
May 21, 2013, 6:42:44 PM5/21/13
to kif-fr...@googlegroups.com
I test against a separate target.   Here's my script and it does not timeout.  

#!/bin/sh

function fail {
echo "$*" >&2
exit 1
}
CONFIGURATION="Release"
PASSWORD="yourpassword"
SCHEME="Testable"
WORKSPACE="/Users/jenkins/.jenkins/common_checkout"
SDK="iphonesimulator"

PROJDIR=$WORKSPACE/iOS/projects/Happy/trunk/Happy

function section_print {
echo "\n=== $* ==="
}

section_print "======================================================>   Building $CONFIGURATION";

if [ -z $CONFIGURATION ]; then
fail "No configuration specified";
exit 1;
fi

#strange way to force backslash
if [ $PROJDIR ]; then
PROJDIR=${PROJDIR%/}
PROJDIR="$PROJDIR/"

BUILD_PATH=$PROJDIRbuild/"$CONFIGURATION"-iphonesimulator

section_print "======================================================>   Project Dir is specified and is $PROJDIR"
cd "$PROJDIR" || fail "no directory $PROJDIR"
pwd
fi

section_print "======================================================>   Unlocking keychain"
security list-keychains -s /Users/jenkins/Library/Keychains/login.keychain
security unlock-keychain -p "$PASSWORD" /Users/jenkins/Library/Keychains/login.keychain

section_print "======================================================>   Cleaning build"
xcodebuild -configuration "$CONFIGURATION" clean || fail "Clean failed"

section_print "======================================================>   Building $CONFIGURATION"
xcodebuild -list

xcodebuild -target IntegrationTests -sdk $SDK -configuration $CONFIGURATION build


section_print "======================================================>   Running Automated Test Script"

echo "About to run waxsim - a long delay here might suggest something is obstructing the view of the simulator on build slave"
BTWAXSIM="/Users/Jenkins/.jenkins/common_checkout/iOS/projects/btwaxsim/trunk/btwaxsim/build/release"
killall -s "iPhone Simulator" &> /dev/null

pwd

if [ $? -eq 0 ]; then

# Stop any running iOS simulators on the OS
killall -KILL -m "iPhone Simulator"

fi

$BTWAXSIM/waxsim -f ipad /Users/jenkins/.jenkins/common_checkout/iOS/Projects/Happy/trunk/Happy/build/$CONFIGURATION-iphonesimulator/IntegrationTests.app > /tmp/KIF-$$.out 2>&1


# WaxSim hides the return value from the app, so to determine success we search for a "no failures" line
# Type "open waxsim" from terminal to see options other than ipad option below
# waxsim -f ipad /path/to/app.app <---- use for ipad only

echo "Testing finished"


# count the number of times "TESTING FINISHED: 0 failures" is found - 0 means that there was a failure
success=`exec grep -c "TESTING FINISHED: 0 failures" /tmp/KIF-$$.out`


# if there was a failure, show what waxsim was hiding and crucially return with a non-zero exit code
if [ "$success" = '0' ]
then
echo "======== PRINT temp file to STDOUT ========"
echo " "
cat /tmp/KIF-$$.out
echo " "
echo "======== End PRINT temp file to STDOUT ===="
echo "==========================================="
echo "GUI Tests failed"
echo "==========================================="
exit 1
else
echo "======== PRINT temp file to STDOUT ========"
echo " "
cat /tmp/KIF-$$.out
echo " "
echo "======== End PRINT temp file to STDOUT ===="
echo "==========================================="
echo "UIAutomation Tests passed"
echo "==========================================="
fi


section_print "======================================================>   Test Simulator Complete"


On Tue, May 21, 2013 at 12:29 PM, Shivani Bansal <she...@gmail.com> wrote:
Hi, 
Same issue i am facing since long. Could you please suggest me how did you solve this
Thanks


On Thursday, April 25, 2013 3:31:26 AM UTC-7, Salvatore Balzano wrote:
Hi,

I've gone into this issue, that I found being quite common over there, and mainly related to user issue.

I've double checked the "who's the user running jenkins" issue, and I'm pretty sure it's the right one, the same user that's logged in on a GUI enabled mac mini. I've also added a "whoami" call to the script that launches waxsim, and I see the right user.
Also, when I launch the jenkins build, I see the simulator icon being added to the dock bar, but it's unresponsive (if I click on it, I can't see the simulator window). After a while, the icon disappears, and the build fails.
If I launch the script by double clicking the file (or using the terminal), I see the simulator performing tests, as expected.

What else can I look for, or which other informations can I add to solve this issue?

--
You received this message because you are subscribed to the Google Groups "KIF iOS Automated Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kif-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
"Thinking + Reasoning = Success" 
- Duncan Wallace
"If you dislike change,  you are going to dislike irrelevance even more."  
- General Eric Shinseki

Reply all
Reply to author
Forward
0 new messages