Hudson + EC2 + Windmill = Cloud Testing

This should give you a pretty good idea how to use the available tools to run your functional tests out there on the cloud.

I do plan to keep updating this post, so consider this a rough draft for the time being! I hope this provides some value.

Setting up Hudson

It would be pretty silly for me to try and re-document the Hudson installation process, so I will refer you to Meet Hudson.

Installing Hudson Plug-ins

Manage Plugins

Click the “Manage Hudson” link, and then “Manage Plugins.

Tabs

Select the “Available” plugins tab.

EC2

Windmill Plugin

Select both the Amazon EC2 plugin, and the windmill plugin, then click Install:Install

You should see the following:

Installed

Click “Restart Now”

Restarting

Success!

Create your slaves

Click “Manage Hudson”

Manage Nodes

Click “Manage Nodes”, then “New Node” in the upper left.

Configure the node

Configure the node, we do 1 executor so that Windmill test runs don’t step on each other, c:\hudson is the standard place to store hudson job workspaces, and to keep other jobs from using our slave we specify “Leave this machine for tired jobs only”, then save.

Setup some jobs

In the upper left link menu, click “New Job”

Configuration Matrix Job

We need to make this a “multi-configuration project”, so that we can run the same job against multiple browsers on multiple slaves. Click save.

Get the test

In this example, I am using wget (which I have installed via cygwin) to pull down the test file into the workspace that we are going to run.

Specify the machines and browsers

In this example I have selected to run this test on three different machines, each against firefox, ie and safari. This would be useful if each of these machines had different versions of the browsers. You can run each of the combination’s from one job.

Windmill Plugin

Test run

Configure your Windmill test run, setting Browser to %browser% allows the job to get the browser from the configuration matrix. We also specify the url, and to run the test file that we download in the previous step. Save.

Setting up EC2

Get an account

Sign Up

Head to http://aws.amazon.com/ and sign up!

Setup Amazon EC2 API Tools

I found this to be relatively straight forward, however these docs look terrifying and poorly organized: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351

These were much easier on the eyes, and to the point.. plus they are OSX specific, which was nice: http://www.robertsosinski.com/2008/01/26/starting-amazon-ec2-with-mac-os-x/

Once you are all setup, allow connections to all images you launch with remote desktop by issuing the following command:

ec2-authorize default -p 3389

Launch Windmill AMI images

AWS Management Console

Sign In
Navigate to the AWS Management Console

Launch Instances

Click to Launch some Instances

Find AMI's

Click to the “Community AMI’s” tab

Search for Windmill

My pre-maid Windmill AMI’s should appear, ‘windmillxp’ specifies that it’s the windows xp Windmill image. Click ‘select’.

Configure Launching

Your security groups will reflect what you configured for your account, but specify the number of slaves you would like to use. Then click “Launch”.

Confirm

You should get the following confirmation that your slaves have been launched.

Dashboard

Start the slave agents

For each of the slaves in the following list:

Slaves

Connect to instance

Check the image, and click connect.

Download Dialog

Click “Download shortcut file”.

Auth

If you have Remote Desktop Installed, you should connect and see the following dialog. I have also found CoRD to be a great alternative on MacOSX.

You will be prompted for a username and password, use ‘Administrator’ and ‘w1ndmill’ respectively. Note: the second character of the password is the number one.

In the Window you can now access, launch a browser and navigate to the URL of your Hudson Instance and find your slave node in the list.
Slave

Click that the node to get it’s configuration screen.

Launch Slave

Click the “Launch” button, your EC2 image is now an available Hudson slave.

Run that Test

Build

Click the clock image on the right to start the job running. In the VM you should see the Windmill test zooming along. You can also navigate around the job to find access to the console output to see line by line what is happening on the standard out.

Other

The manual launching process can be automated using the hudson EC2 plugin for Linux, but is not yet compatible with Windows. Resolving this step would make the whole process of launching cross platform cross browser tests in the cloud a fully automated process, which we are looking forward to!

Other possible ways to handle this are by using the hudson VMWare plugin, and launch images on a VMWare server.

Spread the Word
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Fark
  • Pownce
  • Reddit
  • StumbleUpon
  • Technorati
  • Live
  • Slashdot
  • TwitThis
  • YahooMyWeb
Share This Post
Posted on May 28, 2009 at 6:05 am by adam · Permalink
In: Uncategorized

3 Responses

Subscribe to comments via RSS

  1. Written by Guilherme Silveira
    on July 12, 2009 at 3:55 pm
    Permalink

    Hey there,

    Great news… we have been implementing our own ci server because we needed multiple jobs to be run in parallel and hudson wasnt providing it so far. What about running different – not the same – job in multiple machines. I would actually require to run a different set of tests in each machine, in order to speed up tests – not actually interested in multiple browser in this situation. Is there anything related to that?

    Regards

  2. Written by adam
    on July 28, 2009 at 6:54 pm
    Permalink

    So what I wound up doing was creating a label, and assigning all the slaves I want to run tests on to that label. Now each job is tied to that label, and I can run all my tests at once and they distribute the tests across the different machines in the label to run them much faster. Hudson also has a concurrent builds branch which is getting more stable all the time designed to allow you to queue many of the same job and let them run concurrently on the machines in your label. #windmill or #hudson on freenode if you have questions!

  3. Written by Considering in-house web automation? | Adam Christian
    on March 2, 2010 at 6:38 am
    Permalink

    [...] having someone else manage the infrastructure and avoid those pesky licensing costs. However in my experience the setup is painful, the solutions (EC2, etc.) are slow and lacking some of the features to really [...]

Subscribe to comments via RSS

Leave a Reply


Get Adobe Flash playerPlugin by wpburn.com wordpress themes