2

I am trying to automate a test session from jenkins using Frank.

this is the error message I receive.

  (Frank::Cucumber::FrankNetworkError)
  ./step_definitions/test_steps.rb:30:in `/^I navigate to button V\303\244der$/'
  test.feature:41:in `When I navigate to <link>'
  | Radar       | Norrland    |


  *********************************************
  Oh dear. Your app fell over and can't get up.
  *********************************************

Jenkins checks out the code from git, besides this I have added a shell command as follows.

cd ios    #<--this is so that I go to the root folder, the one with the .xcodeproj project
frank setup
frank build
frank launch
mv features/*.feature Frank/features/.  #<--- this is the testscript
mv features/step_definitions/*.rb Frank/features/step_definitions/.   #<--here it is moved to the newly created frank/features & Frank/features/step_definitions folder
cd Frank/features
cucumber test.feature 

Everything is built the way it should and if I go to the server
and manually type the last row from my shell command will the tests be executed.

Best Regards

Gonen
  • 4,005
  • 1
  • 31
  • 39
Jan
  • 338
  • 3
  • 18
  • Figure you are building on a Mac. Note that Jenkins usually runs as its own user, which is different from your user. This causes many problems unless you run Jenkins as your regular user. – Gonen Dec 21 '12 at 16:07
  • I will have a look at it asap, thanks for the advice – Jan Jan 10 '13 at 21:51

2 Answers2

0

I have personally had many problems running Jenkins on Mac. Especially if you used the Jenskins Mac image installer, Jenkins is always run under the "jenkins" user that is created during installation.

This has given me many headaches with running cucumber from inside jobs or for starting the iOS simulator.

I have finally learned to start Jenkins under my own user, like this: "nohup java -jar /Applications/Jenkins/jenkins.war --httpPort=8080

Since then, I was able to run cucumber without any problems. Hope this helps.

Ru Cindrea
  • 703
  • 2
  • 5
  • 16
0

This happens every time your application crashes. When the application crashes, frank stops receiving events and cucumber ends with the error you see.

There are two possible reasons:

  1. You have a bug in your app that made the app crash
  2. Frank has a bug that made your app crash

You should inspect the crash/application log to see the exact reason.

I learned that is very helpful to capture the application log by the jenkins job, e.g.

function grab_log_and_fail {
    APP_NAME = "MyApplication"

    # get the PID of the last process with the given name
    PID=$( cat /var/log/system.log | grep "$APP_NAME\[" | tail -n 1 | sed -e "s/^.*$APP_NAME\   [\([^\]*\)\].*/\1/g" )

    # grab all the messages from the process with the PID
    cat /var/log/system.log | grep "$APP_NAME\[$PID\]" >"$WORKSPACE/$APP_NAME.log"

    #fail the job
    exit 1
}

You can call it using

cucumber test.feature || grab_log_and_fail

(will grab the log only if cucumber ends with an error)

Sulthan
  • 128,090
  • 22
  • 218
  • 270