Difference between revisions of "New Firefox Performance Testing Documentation"

From CDOT Wiki
Jump to: navigation, search
(Run Firefox Performance Tests)
(Configuration)
Line 32: Line 32:
 
For example:  
 
For example:  
 
<pre>$./perfconfig.sh</pre>
 
<pre>$./perfconfig.sh</pre>
 +
 +
===config.yaml===
 +
 +
 +
==Config info==
 +
 +
Your config.yaml should consist of these items. Refer to [[sample.config]]:
 +
<pre>
 +
    # Filename will be appended to the timestamp in the report filename.
 +
    # Use letters and underscores only
 +
    filename: yourfilename
 +
    # The title of the report
 +
    title: 1 GHz Celeron
 +
 +
    # Name of profile to test
 +
    Test profile 1:
 +
      # Path to Firefox to test
 +
      firefox: C:\Program Files\Mozilla Firefox 2 Beta 1\firefox.exe
 +
 +
      # Preferences to set in the test (use "preferences : {}" for no prefs)
 +
      preferences:
 +
        javascript.options.showInConsole : true
 +
        xpinstall.enabled : true
 +
 +
      # Extensions to install in test (use "extensions: {}" for none)
 +
      extensions:
 +
        # Make sure that the path is directed to the desired location of the extension
 +
        # Need quotes around guid because of curly braces
 +
        "{12345678-1234-1234-1234-abcd12345678}" : c:\path\to\unzipped\xpi
 +
        foo@sample.com : c:\path\to\other\unzipped\xpi
 +
</pre>
 +
 +
==Instructions==
 +
1. Verify that the '''firefox''' path is pointing to the right Firefox instance on your system.
 +
* You will hit a zero division error and some other errors if you don't point it to the right path
 +
 +
2. '''preferences''':
 +
* If you don't have '''preferences''', change to: <pre>preferences : {}</pre> (make sure there is a space between ":" and "{" or else it will cause a syntax error)
 +
* If you do have '''preferences''', refer to [[sample.config]]
 +
 +
3. '''extensions''':
 +
* If you don't have '''extensions''' to install, change to: <pre>extensions: {}</pre> (make sure there is a space between ":" and "{" or else it will cause a syntax error)
 +
* If you do have '''extensions''' to install, refer to this sample:
 +
<pre>
 +
      extensions:
 +
        # Make sure that the path is directed to the desired location of the extension
 +
        # Need quotes around guid because of curly braces
 +
        "{12345678-1234-1234-1234-abcd12345678}" : c:\path\to\unzipped\xpi
 +
        foo@sample.com : c:\path\to\other\unzipped\xpi
 +
</pre>
 +
* Make sure that the path to the extension is right
 +
 +
4. Change '''filename''' and '''title''' to whatever you desire
 +
 +
**You might run into this message on your browser: '''This page should close Firefox. If it does not, please make sure that the dom.allow_scripts_to_close_windows preference is set to true in about:config'''
 +
**Type '''auto:config''' in the address bar and double click on '''dom.allow_scripts_to_close_windows''' to change it to true
 +
* If you see '''processing... Performance Testing is starting''', performance testing is running..
 +
* You can check the progress by the progress bar
  
 
==Run Firefox Performance Tests==
 
==Run Firefox Performance Tests==

Revision as of 03:03, 14 December 2006

Introduction

This documentation is still in progress.

Cygwin Setup

  • Cygwin
    • Download cygwin.
    • Install cygwin with the DOS-style line endings.
    • At minimum, you are required to have the following additional tools:
      • unzip (Archive category)
      • wget (Web category)


unzip (Archive category)
Cygwin.PNG

wget (Web category)
Cygwin2.PNG

Note: For some reason, we can't get output from Firefox unless it's wrapped in a Cygwin sh shell. So we use cygwin for that, and to sync between Firefox runs.

Configuration

Save the script

  • Save this script at a desired location
  • Edit the script to your own choosing. You may provide a list of extensions to install and test in the config.yaml section.
  • Note: This script will run the performance testing. If don't wish for that to happen, simply comment out the last line of the script (to comment out, use #):
#./run_tests.py config.yaml;

Run the script

  • In cygwin, browse to the location where you saved your script.
  • From cygwin, run the script.

For example:

$./perfconfig.sh

config.yaml

Config info

Your config.yaml should consist of these items. Refer to sample.config:

     # Filename will be appended to the timestamp in the report filename.
     # Use letters and underscores only
     filename: yourfilename
     # The title of the report
     title: 1 GHz Celeron

     # Name of profile to test
     Test profile 1:
       # Path to Firefox to test
       firefox: C:\Program Files\Mozilla Firefox 2 Beta 1\firefox.exe

       # Preferences to set in the test (use "preferences : {}" for no prefs)
       preferences:
         javascript.options.showInConsole : true
         xpinstall.enabled : true

       # Extensions to install in test (use "extensions: {}" for none)
       extensions:
         # Make sure that the path is directed to the desired location of the extension
         # Need quotes around guid because of curly braces
         "{12345678-1234-1234-1234-abcd12345678}" : c:\path\to\unzipped\xpi
         foo@sample.com : c:\path\to\other\unzipped\xpi

Instructions

1. Verify that the firefox path is pointing to the right Firefox instance on your system.

  • You will hit a zero division error and some other errors if you don't point it to the right path

2. preferences:

  • If you don't have preferences, change to:
    preferences : {}
    (make sure there is a space between ":" and "{" or else it will cause a syntax error)
  • If you do have preferences, refer to sample.config

3. extensions:

  • If you don't have extensions to install, change to:
    extensions: {}
    (make sure there is a space between ":" and "{" or else it will cause a syntax error)
  • If you do have extensions to install, refer to this sample:
       extensions:
         # Make sure that the path is directed to the desired location of the extension
         # Need quotes around guid because of curly braces
         "{12345678-1234-1234-1234-abcd12345678}" : c:\path\to\unzipped\xpi
         foo@sample.com : c:\path\to\other\unzipped\xpi 
  • Make sure that the path to the extension is right

4. Change filename and title to whatever you desire

    • You might run into this message on your browser: This page should close Firefox. If it does not, please make sure that the dom.allow_scripts_to_close_windows preference is set to true in about:config
    • Type auto:config in the address bar and double click on dom.allow_scripts_to_close_windows to change it to true
  • If you see processing... Performance Testing is starting, performance testing is running..
  • You can check the progress by the progress bar

Run Firefox Performance Tests

  • By default, the run_tests.py file that you need to execute to run the Firefox Performance Testing is located at c:\mozilla\testing\performance\win32\
  • You can run run_tests.py either from the DOS prompt or Cygwin:


DOS

$run_tests.py config.yaml


Cygwin

./run_tests.py config.yaml

What the script does

  • Creates directories needed for the performance testing
    • Directory that holds the files for the performance testing
    • Reports directory to hold the results generated
  • Downloads and installs pre-requisites
  • Write to config.yaml