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
Click the “Manage Hudson” link, and then “Manage Plugins.
Select the “Available” plugins tab.
Select both the Amazon EC2 plugin, and the windmill plugin, then click Install:
You should see the following:
Click “Restart Now”
Create your slaves
Click “Manage Hudson”
Click “Manage Nodes”, then “New Node” in the upper left.
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”
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.
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.
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.
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
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
Navigate to the AWS Management Console
Click to Launch some Instances
Click to the “Community AMI’s” tab
My pre-maid Windmill AMI’s should appear, ‘windmillxp’ specifies that it’s the windows xp Windmill image. Click ‘select’.
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”.
You should get the following confirmation that your slaves have been launched.
Start the slave agents
For each of the slaves in the following list:
Check the image, and click connect.
Click “Download shortcut file”.
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.
Click that the node to get it’s configuration screen.
Click the “Launch” button, your EC2 image is now an available Hudson slave.
Run that Test
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.
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.