QA/Execution/Web Testing/Automation/Selenium Grid: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 119: Line 119:
== Jenkins ==
== Jenkins ==
=== Starting Jenkins ===
=== Starting Jenkins ===
* VPN in via Mozilla-MV to '''qa-selenium.mv.mozilla.org''', look for an existing Terminal/Console window with a Jenkins process -- if there's one there, you should just be able to cursor-up and type Enter/Return to launch
# VPN in via Mozilla-MV to '''qa-selenium.mv.mozilla.org'''
** If not, we launch as follows:
# Look for an existing Terminal/Console window with a Jenkins process
#* If there's one there, you should just be able to cursor-up and type Enter/Return to launch
#* If not, launch as follows:


     java -jar -Xms2g -Xmx2g -XX:MaxPermSize=512M -Xincgc ~/Desktop/jenkins.war
     java -jar -Xms2g -Xmx2g -XX:MaxPermSize=512M -Xincgc ~/Desktop/jenkins.war
Line 129: Line 131:
# Click on [http://qa-selenium.mv.mozilla.com:8080/quietDown Prepare for Shutdown]
# Click on [http://qa-selenium.mv.mozilla.com:8080/quietDown Prepare for Shutdown]
# VNC into '''qa-selenium.mv.mozilla.com''' and go to the Terminal window and CTRL+C (you'll see Java processes shutting down)
# VNC into '''qa-selenium.mv.mozilla.com''' and go to the Terminal window and CTRL+C (you'll see Java processes shutting down)
# Start Jenkins
# Follow the instructions for [#Starting Jenkins]


== Mac OS X-Hostname Setting (shamelessly copied, verbatim, from http://budporter.net/?p=47) ==
== Mac OS X-Hostname Setting (shamelessly copied, verbatim, from http://budporter.net/?p=47) ==

Revision as of 11:40, 18 January 2012

Selenium Grid

moz-grid-config

moz-grid-config is a project for managing our Selenium infrastructure. It includes the latest version of Selenium that we're using, and a mechanism for starting the hub/nodes. You can find documentation on moz-grid-config at the github project page.

Starting the hub

  1. Connect to qa-selenium.mv.mozilla.com
  2. From a terminal (you can use SSH, VNC, or Screen):
   cd ~/moz-grid-config
   ant launch-hub

Starting nodes

  1. Connect to the appropriate machine.
  2. From a terminal (you can use SSH, VNC, or Screen):
   cd ~/moz-grid-config
   ant launch-node

Shutdown

  • Terminate the process using <control>+c

Architecture

  • qa-selenium.mv.mozilla.com (10.250.1.143)
    • Mac Mini; 2.66 Ghz Intel Core 2 Duo; 8 GB
    • Mac OS X 10.6.8
    • Jenkins (dashboard)
    • Selenium Grid hub (console)
  • qa-selenium2.mv.mozilla.com (10.250.1.167) -- NO LONGER USED
  • qa-selenium3.mv.mozilla.com (10.250.1.196)
    • Mac Mini; 2.4 Ghz Intel Core 2 Duo; 4 GB
    • Mac OS X 10.6.8
    • VM: Windows 7 Professional (10.250.7.78)
  • qa-selenium4.mv.mozilla.com (10.250.1.197)
    • Mac Mini; 2.4 Ghz Intel Core 2 Duo; 4 GB
    • Mac OS X 10.6.8
    • VM: Windows 7 Professional (10.250.4.68)
  • qa-selenium5.mv.mozilla.com (10.250.1.222)
    • Mac Mini; 2.66 Ghz Intel Core 2 Duo; 8 GB
    • Mac OS X 10.6.8
    • VM: Windows 7 Professional (10.250.5.71)
  • qa-selenium6.mv.mozilla.com (10.250.1.221)
    • Mac Mini; 2.53 Ghz Intel Core 2 Duo; 4 GB
    • Mac OS X 10.6.8
    • VM: Windows 7 Professional (10.250.2.244)
  • qa-selenium7.mv.mozilla.com (10.250.1.9)

We have several Mac Minis running Selenium nodes, integrated via Jenkins Continuous Build Integration and Selenium Grid. All machines can be VNC'ed into from within the MV-Office Intranet (VPN if offsite). In order to start the entire system (Jenkins, Selenium Grid, and all VMs with Selenium RCs), ensure that all the Mac Minis are powered on and logged in.

Node configuration

Since Selenium 2.14.0 was released and allowed both RC and WebDriver nodes to co-exist each node runs the same configuration of browser nodes.

Firefox version policy

Due to rapid release, we have adopted the following policy for Firefox versions available on our Selenium infrastructure:

  • Nightly
  • Aurora
  • Beta
  • Currently supported Firefox release(s)
  • One previous major Firefox release

Selenium RC

  • Firefox 3.6 (x5)
  • Firefox 7 (x5) - to be removed
  • Firefox 8 (x5)
  • Firefox 9 (x5)
  • Firefox Beta (x5)
  • Aurora (x5)
  • Nightly (x5)
  • Internet Explorer 8 (x1)

WebDriver

Instances are currently set to 1 due to issues with focus.

  • Firefox 3.6 (x1)
  • Firefox 7 (x1) - to be removed
  • Firefox 8 (x1)
  • Firefox 9 (x1)
  • Firefox Beta (x1)
  • Aurora (x1)
  • Nightly (x1)
  • Internet Explorer 8 (x1)

Adding a new browser environment

Configuration

You will need to fork and clone from the moz-grid-config github repository and work on a new branch.

  1. Add the browser, alias, and path to grid_configuration.yml
  2. Add the browser, binary and details to the JSON configuration files
  3. Submit a pull request to the main github repository from your branch

Hub/Nodes

  1. Prepare Jenkins for shutdown - this will allow all currently running jobs to finish, but will not start any new jobs.
  2. Once no jobs are running, shutdown the Selenium Grid hub
  3. Pull in the latest changes from moz-grid-config
  4. Start the Selenium Grid hub
  5. For each Selenium node:
    1. Shutdown the Selenium node
    2. Pull in the latest changes from moz-grid-config
    3. Install the appropriate browser for the new environment
    4. Start the Selenium node

Installing Firefox

Mac OS X
  1. Download the appropriate DMG file
  2. Open the disc image (DMG) and drag Firefox to the desktop
  3. Rename Firefox to include the version number (e.g. 'Firefox 10.app')
  4. Move the file from the desktop into the Application folder
Windows
  1. Download the appropriate MSI file
  2. Run the Firefox installer and select custom install
  3. Change the default install path to include the version number (e.g. 'C:\Program Files\Mozilla Firefox 10\')
  4. Complete the install and uncheck 'set as default browser'

Jenkins

Starting Jenkins

  1. VPN in via Mozilla-MV to qa-selenium.mv.mozilla.org
  2. Look for an existing Terminal/Console window with a Jenkins process
    • If there's one there, you should just be able to cursor-up and type Enter/Return to launch
    • If not, launch as follows:
   java -jar -Xms2g -Xmx2g -XX:MaxPermSize=512M -Xincgc ~/Desktop/jenkins.war

Upgrading Jenkins

  1. Open the Jenkins dashboard (must be on VPN)
  2. Click on Manage Jenkins
  3. Click on Prepare for Shutdown
  4. VNC into qa-selenium.mv.mozilla.com and go to the Terminal window and CTRL+C (you'll see Java processes shutting down)
  5. Follow the instructions for [#Starting Jenkins]

Mac OS X-Hostname Setting (shamelessly copied, verbatim, from http://budporter.net/?p=47)

If you are running a version of OSX prior to 10.5, then look in “/etc/hostconfig” for the “HOSTNAME=” parameter and set it to be the FQDN (Fully Qualified Domain Name) that you want to use. So, for host “foo” located in the domain “bar.com”, the entry would be as follows:

HOSTNAME=foo.bar.com

For OSX 10.5, “/etc/hostconfig” is being deprecated. If you look in “/etc/hostconfig” on 10.5, you’ll see that “HOSTNAME” is no longer listed. There are a couple of preferred methods to do this in 10.5:

sudo hostname -s foo.bar.com

or

sudo scutil –set HostName foo.bar.com

You can verify the change by issuing the “hostname” command without any arguments. The output from the command will display the FQDN of your computer. The command “hostname -s” will display only the host name of your computer (minus the domain name).

Don’t let any of this confuse you with the Computer Name setting in “System Preferences–>Sharing” which really should be called “Bonjour Name”.

References