The Test Repository
Thursday, August 6th, 2009 @ 16:09 by whimboo![]()
![]()
Mozmill test scripts for Firefox require a central place of storage which makes it possible to distribute all files to consumers who want to run our already created tests or to use our self-developed helper functions. Fortunately, this repository has already been created at http://hg.mozilla.org/qa/mozmill-tests/ and is based on a distributed revision control system called Mercurial.
Note: Given that Mozmill is still in development our tests are not in the main development branch like all the other tests from the automated testing frameworks (crash tests, reftests, mochitests, and others). This gives us a kind of independence while we want to improve our tests and Mozmill itself.
Installing Mercurial
If you do not have Mercurial installed yet, please follow these detailed instructions from the Mozilla Developer Center. If setuptools are installed just run the following command:
$ sudo easy_install mercurial
Configuring Mercurial
Once Mercurial is installed the default configuration has to be prepared. All those changes will be made in the default Mercurial resource configuration file whose location can be found within this link. Create or open this config file with your preferred editor and update its contents with your own data so it will look like:
[ui]
username = Your Real Name <user@example.com>
merge = internal:merge (or your-merge-program)
[diff]
git = 1
showfunc = 1
unified = 8
[defaults]
[extensions]
hgext.mq =
[hooks]
prechangegroup.mq-no-pull = ! hg qtop > /dev/null 2>&1
As you can see some more entries have been added. First it is the new section called extensions with the new line: "hgext.mq =". It enables the Mercurial Queue extension we will use for patch creation and management later. With "qdiff=-U 8 -p" the diff output for mq is set to the same style as you get with Mercurial itself. Last but not least a hook has been added to make sure that you don't destroy the local repository when calling "hg pull" while a patch is applied. With these changes you are prepared to get your own copy of the repository now.
Cloning the Test Repository
The next step to run existing Mozmill tests in Firefox is to get a local copy of the Mozmill test repository. There is only one command necessary which will retrieve all the files from the central repository and save them to a subfolder of your choice:
$ cd %folder%
$ hg clone http://hg.mozilla.org/qa/mozmill-tests [subfolder]
A copy of the repository can be found under the folder given by the subfolder parameter. If that parameter has not been specified the copy has been saved under mozmill-tests.
Updating the Local Copy
From time to time new tests will be checked into the repository. If you prefer to stay up-to-date and have them in your local copy too, an update has to be run by yourself. With the command below all new, changed, and removed files will be updated in your local copy:
$ hg pull -u
Note: Before you run any of the Mozmill tests in Firefox make sure you have the latest revision checked out.
Now you are ready and you can run those tests on your own box.