PageRenderTime 306ms CodeModel.GetById 152ms app.highlight 5ms RepoModel.GetById 107ms app.codeStats 0ms

/automation/README

http://showslow.googlecode.com/
#! | 103 lines | 79 code | 24 blank | 0 comment | 0 complexity | 5d93232f569c5d1e80424827026fc8f6 MD5 | raw file
  1###########################################################################
  2##
  3## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
  4## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  5## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
  6## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
  7## HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  8## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
  9## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
 10## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
 11## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 12## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 13## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 14##
 15###########################################################################
 16
 17This directory contains scripts for use in the automation (specifically
 18Mozilla Firefox) and benefit greatly from the following patch which will
 19be applied to the Google Page Speed v1.7 tree:
 20
 21    http://page-speed-codereview.appspot.com/151001
 22
 23The script(s) here are still under heavy development, but are seeing 
 24production use and monitoring hundreds of URLs via simple linux virtual
 25machine zombies.
 26
 27Instructions:
 28
 29    0.  Setup Xvfb (virtual X11, essentially headless).  A good method to 
 30        test the configuration and setup the Firefox profiles as well as 
 31	the execution of the script/process is to use vncserver and 
 32	initially pass the automation script the appropriate DISPLAY 
 33	value without having to install a full x11 instance.  Then once 
 34	everything is setup run the script against Xvfb.
 35
 36            Xvfb <display> -screen <screen#> <height>x<width>x<color depth>
 37                display 	= DISPLAY ASSIGNMENT (DISPLAY=:1)
 38		screen  	= screen number
 39                height  	= virtual screen height
 40		width   	= virtual screen width
 41		color depth  	= color bit depth (e.g. 24)
 42
 43            Example:
 44	        Xvfb :1 -screen 0 1152x864x24 +extension RANDR &
 45
 46    1.  Create a text file of URLs to be monitored, each URL on a separate
 47        line and make it available via HTTP to the zombies:
 48
 49            http://www.example.com/test_urls.txt:
 50 
 51	        http://www.google.com/
 52	        http://www.yahoo.com/
 53
 54    2.  Create Mozilla Firefox profile(s) (see STEP 0 for advice).  An
 55	interactive process is NOT required.  Edit the prefs.js file with
 56	appropriate values after cloning a working profile.  Install and 
 57	configure both YSlow and Page Speed.  Session crash recovery _MUST_
 58	be disabled via about:config. 
 59
 60            ** SESSION RECOVERY MUST BE DISABLED **
 61
 62            user_pref("browser.sessionstore.resume_from_crash", false);
 63
 64	Other variables to consider:
 65	    
 66            * cache size
 67            * pop-up suppression
 68            * disable java script resize & position
 69            * disable update checks
 70            * delete history data (cookies)
 71            * disable all warnings
 72            * where to dump Google Page Speed optimization data
 73
 74	To clone or backup an existing profile see the following Mozilla
 75	documentation:
 76
 77        http://support.mozilla.com/en-US/kb/Profiles#Moving_your_profile_information  
 78
 79    3.  Manually run and confirm the test_harness.pl script execution.  Simply run
 80	the script without any args for usage.
 81	
 82	usage:  test_harness.pl --display <DISPLAY> --firefox <PATH> --source <URL> \
 83                    --profile <PATH> [--timeout <SECONDS>] [--quiet] [--verbose]
 84
 85    		--display  x11 display ( e.g. ':99' )
 86   	 	--firefox  path to Firefox binary ( default = /usr/bin/firefox )
 87    		--profile  path to Firefox profile ( e.g. /home/foo/profile )
 88    		--source   uniform resource locator ( e.g. http://www.example.com/list )
 89    		--quiet    supress debug messages ( default TRUE )
 90    		--timeout  thread execution timeout in seconds ( default = 60 )
 91    		--verbose  enable verbose ouput to STDOUT ( default FALSE )
 92
 93    4.  Edit the monitor.sh script to reflect your desired settings.  The script can
 94	be run manually and once tested (see STEP 0) added to cron and exists as a 
 95	wrapper for execution of the test_harness.pl script.  I have a number of post
 96	execution clean-up commands which purge Page Speed optimization data, Flash
 97	plug-in data, any "downloads" automatically attempted, etc., which run after
 98	each pass.
 99
100	    Example:
101
102    	        0,15,30,45 * * * * /home/tmnz/monitor.sh >> /home/tmnz/monitor.log 2>&1
103