Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Latest commit

 

History

History
123 lines (82 loc) · 3.72 KB

quickstart.md

File metadata and controls

123 lines (82 loc) · 3.72 KB

👈 Back to README

Development Quickstart

Test Pilot uses Node.js v8.9.4 for development. You may be able to get by using the most current release, but earlier versions will definitely result in error messages and problems. Node Version Manager might come in handy for installing the right version of Node.js.

First Things First

Make sure you clone the Test Pilot repo:

git clone https://github.com/mozilla/testpilot.git

For Linux & OS X hosts

Once you've got a good version of Node.js installed for your operating system, here are some shell commands to get you started on Linux & OS X:

cd testpilot

# Set up add-on environment and build an unsigned package
cd addon
npm install
npm run package

# Set up frontend web site environment
cd ..
npm install

# Add hostname alias to /etc/hosts and start up dev webserver
echo '127.0.0.1 example.com' | sudo tee -a /etc/hosts
npm start

Note: While you will be able to see the web site locally via http://localhost:8000/ - the example.com hostname alias is important to several features of this site for local development. The domain example.com is whitelisted and allowed to use the mozAddonManager api to manage add-ons.

These steps will give you a working development web server and file watcher that will rebuild site assets as you edit. Just a few more steps and you should be on your way:

  1. Install Firefox Developer Edition.

  2. Install the DevPrefs add-on in Firefox Developer Edition.

  3. Configure your browser to use your local Test Pilot server:

    1. Type about:config in the URL bar, acknowledge the warning that appears.

    2. Right click the list of preferences to summon a menu, pick New > String to create a new preference.

    3. Enter testpilot.env for the name.

    4. Enter local for the value.

    5. Right click the list of preferences to summon a menu, pick New > Boolean to create a new preference.

    6. Enter extensions.install.requireBuiltInCerts for the name.

    7. Enter false for the value.

    8. Right click the list of preferences to summon a menu, pick New > Boolean to create a new preference.

    9. Enter xpinstall.signatures.required for the name.

    10. Enter false for the value.

    11. Enter extensions.webapi.testing for the name.

    12. Enter true for the value. This is needed for whitelisting mozAddonManager on testpilot.stage.mozaws.net, testpilot.dev.mozaws.net, and example.com.

  4. View your local site in Firefox Developer Edition at https://example.com:8000/

The Test Pilot add-on is a key component of this project - among other things, it communicates with the site and grants the ability to enable & disable experiments. Setting up your browser with the steps above should make it easier for you to get it working.

For Windows hosts

After installing Node.js for Windows, run these commands to get started:

cd testpilot

:: Set up add-on environment and build an unsigned package
cd addon
npm install
npm run package-win

:: Set up frontend web site environment
cd ..
npm install

Now, open a second command prompt window, this time with admin privileges and run this:

:: Add hostname alias to /etc/hosts and start up dev webserver
echo 127.0.0.1 example.com >> %WINDIR%\System32\Drivers\Etc\Hosts

Go back to the previous command prompt window and run

USE_HTTPS=1 npm start

Follow the remaining instructions from Linux & OS X section and you're all set.