PageRenderTime 54ms CodeModel.GetById 23ms RepoModel.GetById 0ms 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. This directory contains scripts for use in the automation (specifically
  17. Mozilla Firefox) and benefit greatly from the following patch which will
  18. be applied to the Google Page Speed v1.7 tree:
  19. http://page-speed-codereview.appspot.com/151001
  20. The script(s) here are still under heavy development, but are seeing
  21. production use and monitoring hundreds of URLs via simple linux virtual
  22. machine zombies.
  23. Instructions:
  24. 0. Setup Xvfb (virtual X11, essentially headless). A good method to
  25. test the configuration and setup the Firefox profiles as well as
  26. the execution of the script/process is to use vncserver and
  27. initially pass the automation script the appropriate DISPLAY
  28. value without having to install a full x11 instance. Then once
  29. everything is setup run the script against Xvfb.
  30. Xvfb <display> -screen <screen#> <height>x<width>x<color depth>
  31. display = DISPLAY ASSIGNMENT (DISPLAY=:1)
  32. screen = screen number
  33. height = virtual screen height
  34. width = virtual screen width
  35. color depth = color bit depth (e.g. 24)
  36. Example:
  37. Xvfb :1 -screen 0 1152x864x24 +extension RANDR &
  38. 1. Create a text file of URLs to be monitored, each URL on a separate
  39. line and make it available via HTTP to the zombies:
  40. http://www.example.com/test_urls.txt:
  41. http://www.google.com/
  42. http://www.yahoo.com/
  43. 2. Create Mozilla Firefox profile(s) (see STEP 0 for advice). An
  44. interactive process is NOT required. Edit the prefs.js file with
  45. appropriate values after cloning a working profile. Install and
  46. configure both YSlow and Page Speed. Session crash recovery _MUST_
  47. be disabled via about:config.
  48. ** SESSION RECOVERY MUST BE DISABLED **
  49. user_pref("browser.sessionstore.resume_from_crash", false);
  50. Other variables to consider:
  51. * cache size
  52. * pop-up suppression
  53. * disable java script resize & position
  54. * disable update checks
  55. * delete history data (cookies)
  56. * disable all warnings
  57. * where to dump Google Page Speed optimization data
  58. To clone or backup an existing profile see the following Mozilla
  59. documentation:
  60. http://support.mozilla.com/en-US/kb/Profiles#Moving_your_profile_information
  61. 3. Manually run and confirm the test_harness.pl script execution. Simply run
  62. the script without any args for usage.
  63. usage: test_harness.pl --display <DISPLAY> --firefox <PATH> --source <URL> \
  64. --profile <PATH> [--timeout <SECONDS>] [--quiet] [--verbose]
  65. --display x11 display ( e.g. ':99' )
  66. --firefox path to Firefox binary ( default = /usr/bin/firefox )
  67. --profile path to Firefox profile ( e.g. /home/foo/profile )
  68. --source uniform resource locator ( e.g. http://www.example.com/list )
  69. --quiet supress debug messages ( default TRUE )
  70. --timeout thread execution timeout in seconds ( default = 60 )
  71. --verbose enable verbose ouput to STDOUT ( default FALSE )
  72. 4. Edit the monitor.sh script to reflect your desired settings. The script can
  73. be run manually and once tested (see STEP 0) added to cron and exists as a
  74. wrapper for execution of the test_harness.pl script. I have a number of post
  75. execution clean-up commands which purge Page Speed optimization data, Flash
  76. plug-in data, any "downloads" automatically attempted, etc., which run after
  77. each pass.
  78. Example:
  79. 0,15,30,45 * * * * /home/tmnz/monitor.sh >> /home/tmnz/monitor.log 2>&1