10/18/2011

It's been a while since I had written latest post and it's just because I have too little time and too little readers, so I wasn't sure it worthies spending time. But after this post by Marlena Compton I've decided to keep it on.

So, this post is about building continuous integration for iOS application with Cucumber + Frank as acceptance testing framework and Bamboo as CI server.

Before you read everything else, I want to warn you that after a month of running CI, I come to the conclusion that Frank may be not the best solution for UAT, but there was nothing comparable at the time I've started. Now, however, you can try Ruby bindings for NativeDriver which were written by Jari Bakken (if anybody doesn't know, he's an awesome author of Ruby bindings for Selenium WebDriver and Watir-WebDriver) and me.

Regardless your choice, here is the flow which should be catered:

Developer pushes some changes to develop branch of application repository.

Bamboo fetches the changes and apply them.

Application is built with Xcode.

Acceptance tests are run on new build.

Each test produces a video with itself running.

The results of the tests are parsed and if there are failures, developer receive email notification on that.

Step one - frankified application

Proceeding from assumption you already have Xcode project of your iOS application the following steps are required

Make custom "frankified" target of your application which will be built with Frank code. It's described good at Frank tutorial while it's rather nontrivial (especially for people like me which have never worked with Xcode and even MacOS X). You may get some errors even after following the tutorial step-by-step, but don't give up.

Step two - writing Frank tests

When you have created "frankified" target, try writing some basic Frank tests for your app and see if it's running. Tutorial has everything necessary for this step.

Step three - getting MacOS-powered hosting

In my case, Bamboo was installed and running on Linux server and iOS app wouldn't build on it, so we had to make all this stuff run on separate Mac server. We've selected http://www.macminicloud.net/. Nice thing was that it has MacOS X 10.7 Lion and you're provided with both SSH and VNC access.

Step four - adding MacMini as remote agent to Bamboo

The tests should be run on MacMini, but the results and all this stuff should be shown in Bamboo itself which is on Linux server. So, you have to create a "remote agent" for Bamboo.

Connect to MacMini and place downloaded JAR to home folder on MacMini.

Run it with "Running a Remote Agent" command.

Wait until it appears on Agents page in Bamboo.

When it does, open it by clicking on its name.

In "Agent-Specific Capabilities" click to "Add Custom" and create new custom capability like isMacMini key and true value. This is needed to ensure the plan is built on MacMini remote agent and not on local agent.

Step five - create your iOS app plan

Create simple plan just like you usually do and job for it. The only difference is to create requirment for MacMini. Go to job configuration and Requirements, then select "isMacMini" from Requirement list and click "Add". It will ensure that job is running on MacMini.

N.B. If you have any different plans which should be run on local agent, add custom capability to it (e.g. isLocal = true) and add it as requirement to your plans' jobs. Otherwise, the jobs may run on MacMini too.

Step six - configure plan's tasks

I have two tasks in job: one for running tests which call simple Bash script (Command) and one for parsing test results (JUnit parser). The following script builds application and run tests:

This script works with recorded videos but you can remove this code if you don't record them in Frank tests.

(optional) Step seven - produce video of tests as artifcats

If your Frank tests record videos, you can publish them as artifacts of the build.
To record videos, copystart_recording and stop_recording methods to your env.rb from frank_helper.rb (or require it) and call first in Before hook and latest in After hook.
To publish videos as artifacts, go to job configuration, click "Artifacts" and add new one with Location of videos directory and Copy Pattern *.mov.

Step eight - have some beer and chill out, you've done great

What else?
It's still not finished yet. We also need to publish ipa file as an artifact and push it to www.testflight.com.

The flexibility of iOS accommodates every unique concept in the form of applications. Today, Apple app store comprises of more than 500 thousand applications, supporting the sprouting of various iPhone mobile application development companies

Thanks for Information Quality Assurance is the systematic process to check whether the product developed from the company is perfect and meeting the requirements specified for the product. This Quality Assurance was introduced in World War II when the weapons used were inspected and tested after manufacturing, but now the situation have changed and every company is following the advanced technologies for quality and most of the companies will have a separate department for the Quality testing.QA Online Training

nice blogsVideocon Telecommunications Limited, a Videocon group company offers GSM mobile services GSM service under the brand name Videocon. The services are already up and running in Punjab*, Gujarat, Haryana, Madhya Pradesh and soon will be present across the country.