Labs/Test Pilot/ExperimentAPI: Difference between revisions

Line 5: Line 5:
Test pilot experiments and surveys are hosted on https://testpilot.mozillalabs.com.  This URL is hard-coded into the Test Pilot extension.  Note that the experiments and surveys are served exclusively over SSL to reduce the possibility that a man-in-the-middle could substitute malicious code.
Test pilot experiments and surveys are hosted on https://testpilot.mozillalabs.com.  This URL is hard-coded into the Test Pilot extension.  Note that the experiments and surveys are served exclusively over SSL to reduce the possibility that a man-in-the-middle could substitute malicious code.


== index.json ==
== The Index files ==


This is a simple directory file that specifies paths to experiment and survey files.  To add a new experiment or survey, add a new entry to index.json.
The server holds an index file which lists experiments to run.  The clients check this file (on startup, then once per day thereafter) and then download the experiments they find listed there.  To release a new experiment or survey, we add it to the index file. To stop giving out an experiment or survey, we take it out of the index file.  (Clients who already have it will keep running it).


All the Test Pilot clients, starting with version 0.3, check index.json once per day, and if they see something new listed there, they download and run it.
The canonical index file is at [https://testpilot.mozillalabs.com/testcases/index.json].  You can go have a look at it right now.  It's human readable and fairly self-explanatory.


The top level of the JSON has a property called experiments, which is an array of objects with names and filenames:
The top level of the JSON has a property called experiments, which is an array of objects with names and filenames:
Line 18: Line 18:
                 {"name": "Survey For New Test Pilots",
                 {"name": "Survey For New Test Pilots",
                   "filename": "new_pilot_survey.js"}]}
                   "filename": "new_pilot_survey.js"}]}
In order to develop and test experiments that we're not ready to deploy, we have an alternate index file for developers only.  This lives at [https://testpilot.mozillalabs.com/testcases/index-dev.json].  To make your copy of the Test Pilot client use this file:
# go to about:config
# find the pref called extensions.testpilot.indexFileName
# change its value to index-dev.json
Using index-dev.json is a good idea if you are working on developing test pilot studies.


== Version control for experiment/survey code ==
== Version control for experiment/survey code ==
1,007

edits