Explaining how the real world works!     RSS Feed The Automated Tester on Twitter The Automated Tester on LinkedIn The AutomatedTester on github

Using Travis CI for building and testing Firefox addons

Tue 28 Feb 2012

Let me start by explaining what Travis CI is. Travis CI is an open source cloud CI solution that integrates with GitHub so you can build and test your applications. It is free to use for OSS projects. They started only supporting Ruby and have grown really quickly to support other languages.

The other week I explained what my team is up to and I mentioned that we are working on a Firefox Addon to visualise what is happening with Garbage collection in the browser. This is very important since garbage collection taking a lot of time can have a negative impact on the user experience.

This week I wanted to make sure that we have a CI for the work that we are doing so we can spot if we have any regressions. We all know that manual testing is long, tedious and can miss things. Below are the steps that you need to take to get a JetPack addon built and tested. This is for Addons not built on the Builder site. In theory this will work on older addons too.

  • Add a .travis.yml to the root of the repository
  • Add the following lines to it. Make sure that you run it on a Node Worker so you don't swamp the ruby machines

         language: node_js
              before_script:
                - sh -e /etc/init.d/xvfb start
                - git submodule update --init
                - cd addon-sdk
                - . bin/activate
                - cd ../extension
             env:
               - DISPLAY=':99.0'
    
    
             script: cfx test     

  • Turn on Travis CI for that project. You can do this by logging in to Travis CI and flicking the switch on your profile page or you can set it up manually.
  • Commit the .travis.yml file to your remote repo and watch it run.

You can see an example of this here. Thanks to Travis CI guys for making this possible and if you find it useful show them some Love!

    Area: blog

blog comments powered by Disqus