QA/Telemetry/Installing Staging Server

From MozillaWiki
< QA‎ | Telemetry
Jump to: navigation, search

Quick Summary

The following document will guide users on how to install and setup a telemetry experiment staging server on the local machine. Once the staging server is installed, Firefox will be able to contact the server and install the current experiment.

Here are two ways of checking to see if an experiment has been installed:

  • Checking "about:addons" - You should see an "Experiments" category being listed
  • Checking "about:support" - Will list the active experiments under "Experimental Features"

Quick Notes:

  • This guide assumes that you're using either OSX or Linux. Trying to get the server working on Windows is just a pain.
  • This can also be installed on a cloud instance and doesn't necessarily have to be installed locally. I personally have a telemetry experiment installed on a Digital Ocean linux instance that I use as my main testing server.

Initial Setup

The first step is to run the OSX bootstrap command and get our development environment installed. The command can be found in the link below: (right below One-Line Setup (Try This First!))

Note: Installing a development environment is not the scope of this guide so please consult the MDN documentation if you run into any issues.

Clone the telemetry experiment repository using the following command:

Once the repository is cloned, a directory named telemetry-experiment-server should have been created

  • Switch into the telemetry-experiment-server directory
  • Pull and apply the latest changes using hg pull and then hg update

Once you've cloned the telemetry-experiment-server repository, we'll need to install genshi as it's one of the dependencies needed to get the server working correctly. To install genshi simply type the following command into the terminal and follow the on-screen directions:

  • pip install Genshi


Ensure you're still in the telemetry-experiment-server directory and run the following command in the terminal:

  • python <your directory name> <"base URL">

The above command will create all the necessary files to get the server running and place them into the specified directory. In this case, the files will be placed into a directory names _out and the server will be running on the localhost using port 8080.

Once you've ran the above command, switch into the _out directory and run the following command in the terminal:

  • python -m SimpleHTTPServer 8080

The above command will start the HTTP server that will be hosting your staging server. If you navigate to http://localhost:8080, you'll notice a "Firefox Telemetry Experiments" HTML page.