Using Lava Lamps for Continuous Integration build status notifications

Taking the idea of using Lava Lamps as notification tools for your Continuous Integration status, green lamp for success, red lamp for failure, the so called eXtreme Feedback Devices, and using as a guide the instructions in Pragmatic Automation, I have made some improvements to use remote notification, meaning that lamps don’t need to be connected to the build server, and a more automated process, that will turn off the lamps out of business hours.

The code is in a new project, Continuous Lava, in case it’s useful for somebody else. There are two parts, one for Apache Continuum and one for CruiseControl.

Actually, it is not necessary to use lava lamps but you can turn on and off any device you plug to the X10 power adapters. Imagine a loud siren, or my favorite, electric discharges to developer’s chairs!!! (we’ll leave this as an idea for future projects)

UPDATE: fixed the link to Pragmatic Automation

Enterprise build and Test in the Cloud with Selenium II

In my previous entry I introduced Selenium and a setup for running automated builds in the browser.

How can you achieve the multi-browser multi-environment testing?
There is a subproject of Selenium called Selenium-Grid that works in a heterogeneous cluster of machines. Install a selenium hub in one server and start the selenium remote clients in the machines with the environments you want to test. For instance you can have a windows machine with IE 7 and Firefox 3, another one with IE 6, a linux machine with Firefox 2 and a OS X with Safari. There’s no limit in the number of machines that you can attach to the hub, and the hub redirects the tests to the machine that fulfills the environment you request in your tests.

At this point you can have a very nice integration testing environment, with the continuous integration server deploying your app every day, and running the Selenium tests in several machines with different operating systems and browsers.

Now the bad news, you may have noticed already that having a bunch of machines dedicated to QA just to run once a day can be quite expensive. Another issue is that Selenium tests, as they run in the browser, are not particularly fast.

But it’s a great use case for cloud computing. Using Amazon EC2 you can have machines with different environments (Linux, Windows, Solaris,…) and browsers (IE, Firefox,…) and pay just for the time they are running. Let’s say you need 5 combinations of OS/browser and your tests take 2 hours in each of them. If you run the tests once a day you could end paying

5 machines * 30 days * 2 hours * 0.10 $/hour (approx) = 30$ month, results in 2 hours

compare it with the cost of 5 machines, power, space, hardware maintenance,…

Not only that, but you could parallelize your tests, using Selenium with TestNG for instance, and get the results faster. Particularly, using EC2, if you start twice as many machines to get the results in one hour instead of two, you would pay

10 machines * 30 days * 1 hours * 0.10 $/hour (approx) = 30$ month, results in 1 hour

exactly the same!

And if you need to really really get those results fast, you are not constrained by your hardware

100 machines * 1 day * 1 hours (the minimum charge is one hour) * 0.10 $/hour (approx) = 10$ day, but with results in 6 minutes

assuming that your tests are split and can be run properly in parallel.

You can see a demo of how does it work in our Maestro S+ page. Obviously you can set this environment up yourself, but if you need help we can assist you setting the environment up, creating an outsourced on-demand QA team, or subscribe to a fully hosted service where we will handle all your continuous integration and testing needs using open source, Apache licensed, software, with a continuous integration server, Apache Continuum, artifact repository, Apache Archiva, and a list of browsers and environments to test on that we’ll maintain for you, and paying just for the time you need them.

Enterprise build and Test in the Cloud with Selenium I

I introduced Amazon Web Services and Cloud computing in previous posts (Amazon Web Services: an introduction, habemus Windows, tools), now let’s get full advantage of them in a practical application.

For those not familiar with Selenium, it’s a testing library that allows you to write integration tests to run in the browser, and when I say in the browser I mean it, you can tests how web applications behave when using different browsers: Internet Explorer, Firefox, Safari,… and we all know how painful cross-browser compatibility can be.

With Selenium you can write the tests in different languages: Java, Ruby, Groovy,… but, and this is a huge plus, you can also record them in Firefox using the Selenium IDE AddOn, and then run them with playback or export them to any of the languages supported.

Now follow me to this scenario. You have a team of developers writing a webapp. You can take anybody with a minimum experience (an user!) and tell them to use the site while SeleniumIDE records what they are doing. Then export the recording and add it to your integration builds to make sure it doesn’t break in future developments. Imagine also what you could achieve with experienced QA people, that don’t need to be developers at all nor know the internals of your app, and that can apply QA practices, trying to make your webapp break in any possible way. Sounds interesting? Keep reading

Let’s say that the site needs to be supported in different browsers too, Internet Explorer, Firefox and Safari. With Selenium you can run the same tests previously recorded against any browser.

At this point you have a development practice where developers develop, and a QA team that can be just test experts, not developers, either inside or outside your company or department, recording and running tests using only the requirements. Not a bad thing to have, but let’s make it better using automation.

Let’s assume you already have a working automated build and continuous integration, I know for many people is a big assumption, but let’s have hope ;), and assume you are using Maven and Continuum, not necessary, but that’s what I’m more familiar with. It is pretty easy to add Selenium testing to run as part of the build. With the Selenium Maven plugin you can start the Selenium server, launch the tests that will run the browser and execute the in-browser testing, and stop Selenium server at the end. When you have that running on Maven is straightforward to get it working in Continuum. For the gory technical details you can read my previous post Functional testing with Maven, Cargo and Selenium.

Will continue in my next entry

Amazon Web Services: tools

Second entry in the series: Amazon Web Services: an introduction

Amazon provides some tools to interact with its Web Services, and many others exist provided by 3rd parties. Here is my selection

S3 tools

JetS3t

JetS3t is a free, open-source Java toolkit and application suite for the Amazon Simple Storage Service (Amazon S3). The toolkit provides Java programmers with a powerful yet simple API for interacting with S3 and managing data stored there, while the applications allow anyone to easily manage and interact with their S3 accounts.

JetS3t is composed by a java library to access S3, a command line tool to synchronize local folders to S3 (s3sync) and a GUI to upload/download files (cockpit)

EC2 tools

ElasticFox

A graphical interface to Amazon EC2 web service as a Firefox addOn, provided by Amazon

You can do pretty much everything with it, register instances, start/stop them, manage access keys, security groups, elastic ips,
EBS volumes,…

Amazon Management Console

A web based interface to Amazon EC2 launched recently by Amazon. Same functionality as ElasticFox

Amazon EC2 API tools

The command line version, you won’t need it if using ElasticFox, unless the command line is your thing

Amazon EC2 AMI tools

The Amazon EC2 AMI Tools are command-line utilities to help bundle an Amazon Machine Image (AMI), create an AMI from an existing machine or installed volume, and upload a bundled AMI to Amazon S3.

Even using ElasticFox you’ll need it in your running instances to create new images from them (only for *nix, Windows images are bundled from Elasticfox or other GUI)

EC2 services

Morph

Morph AppSpace allows you to run webapps with no effort. You provide them with a war (for Java) or your Rails, Grails or PHP app and they’ll run it for you in the cloud, with a DB (postgres or mysql) with warm backups, a webserver, continuosly monitored and a two machine cluster for load balancing and high availability, all from 1$ a day. There’s a development version to try it for free.

How it works for Java apps? You just need to access your database connection pool using JNDI. They will provide you the resource name to use.

Morph AppCloud is another product that adds more flexibility, providing a web based cluster editor where you can design your cloud just by dragging and connecting the modules provided (ie. Jetty web server, mysql master, mysql slave, load balancer,…), then just click to run it.

Disclaimer: I know the guys behind Morph and have done some work for them

Rightscale

It’s a lower level service where you can interact with all the EC2 operations. You can create images, start/stop them, health montirs,… all through their web interface. You have a developer edition to try it for free

CohesiveFT

It’s more of a provisioning system where you select components and create an image (Elastic Server) to run it in EC2, VMware, and other virtualization frameworks, and with a management web interface to start/stop the components, monitor the services running,…

They have a list of components and templates, mostly open source projects, and you can add your own too.

Madrid this Sunday 18th

If you are not in the Madrid area you can ignore this post ;)

Voy a andar entre maana jueves y el domingo por Madrid de camino a Los Angeles, y voy a quedar con alguna persona que conozco por alli que trabaja en lo "nuestro", especialmente open source, para intercambiar experiencias.

Asi que si os quereis pasar o comentarselo a alguien interesado:

Domingo 18
20.30 en The Clover House (Metro Las Tablas)
http://madrid.salir.com/the_clover_house

Enviadme un mail o dejad un comentario por si hay cambio de planes.

Perdon por la noticia de ultima hora.

ACTUALIZACION: me he quedado sin avion asi que lo vamos a mover al domingo, mismo sitio, misma hora