Automated MozMill tests for Thunderbird

Following on from getting the make mozmill harness working last week, we’ve now got a Tinderbox up and running with MozMill:

MozMill results from a successful run.

As the mozmill make target acts in a similar style and produces similar output to xpcshell-tests getting a tinderbox set up was relatively easy. The basic order of events was: MozillaBuild upgrade to 1.4, installation of MozMill with one minor patch, patch the buildbotcustom code to provide a mozmill test in the unit test factory.

For now we’ve just installed MozMill manually, and this box is just one box running on the ThunderbirdTest tree. We still have to work out how we’re going to deploy MozMill normally, we’re watching the discussion in bug 457265 to see what is going to happen there. In the meantime we’re leaving the tinderbox running to see how stable the tests are.

Even though the box has just been set up as a “see how it goes” box, it has already caught its first regression 🙂 . About 5 hours after we first got the tests passing, a patch was checked into comm-central that worked fine on our Thunderbird 3/Gecko 1.9.1 build but regressed the trunk builds (built on Gecko 1.9.2). We’re pretty sure this is due to the recent focus changes in 1.9.2 – the hack we’ve put in for 1.9.1 shouldn’t be necessary on 1.9.2 (we’re currently checking that assertion out).

If we didn’t have the box we could have gone for a month or so before finding out about the regression – now we know when and why it happened which will make fixing it a lot easier.

The MozMill harness is currently Thunderbird specific – we did this so that we could get MozMill up and running quickly with short iterations as Thunderbird doesn’t have other UI test harnesses available. If anyone wants to make the harness work with other comm-central apps and/or move it over to mozilla-central then I would be more that happy to discuss ways of making that happen, I’m just not likely to have time to do the work until after Thunderbird 3 is out.

MozMill make harness for Thunderbird testing

Thunderbird has been lacking front-end user interface tests for a while. We aren’t easily able to run mochitest or chrome tests, so we’ve been relying on xpcshell-tests and our nightly testers.

Hence, since MozMill was initially released, we’ve been looking at it to drive our front-end testing on Thunderbird. Over the last couple of months, Andrew and others have been writing MozMill tests to cover their work. The biggest set of these is the folder-display tests that were written to cover the re-factoring of the code behind the folder and message displays.

Whilst they have been doing that, I have been driving forward, with Andrew‘s and Ludovic‘s help, making a MozMill harness capable of running the tests with Thunderbird and hooking it into the build system. As a result, from today, if you do a Thunderbird build and have the appropriate MozMill components installed, you can now run:

make mozmill

and this will run all the mozmill tests that we’ve got checked in. There’s also a mozmill-one target for running a single test or a single set of tests.

With this simple way to run it, we’re now looking at hooking up a tinderbox to run the tests whenever someone checks in – just like our other test boxes. The tinderbox will initially just be a box we’re testing the automation on – there’s a few rough edges we need to smooth out e.g. installation of mozmill, how stable is it as a platform etc – but it is a start. More on that once it is up and running.

There are also other ways we are thinking of extending these tests – hooking up to fake servers and including as part of make package – so that anyone can download the tests and run them on a relevant build (and write more!).

Documentation for how to install and run the Thunderbird MozMill tests can be found on devmo.

Content Loading in Thunderbird

I’ve not blogged for a while 🙁 Mostly because I was helping getting Thunderbird 3 Beta 3 out the door and working on a few interesting projects.

However time to start again, and as Andrew alluded to earlier a lot of my time has been spent looking at loading content into Thunderbird and the various issues surrounding it.

We’re not trying to be a browser, but we believe there are places where Thunderbird can benefit from having content loaded and even the user interacting with it.

So far, we’ve tweaked the content policy so that it doesn’t assume every iframe/browser element in the mail window is the message pane, and we can therefore load content correctly. The best example of where we use this currently, is the What’s New tab that we display to the user:

Thunderbird's What's New Tab

Alongside this, we’re also looking at making sure extensions can use appropriate hooks to display content to the user (more on this later). We think there are many reasons why extensions could want to do this – Andrew’s jetpack example actually has two instances – with jetpack installed we can display jetpack’s about:jetpack page and then we can display the twitter page instead of the email. I’m sure extension authors can come up with many more ideas to experiment with.

I’ll post more about this and the other stuff I’m doing as I get them completed.