Version information
Start using this module
Add this module to your Puppetfile:
mod 'jhoblitt-selenium', '0.2.0'
Learn more about managing modules with a PuppetfileDocumentation
Puppet selenium Module
Table of Contents
Overview
Manages Selenium Server 2 - Standalone and Grid
Description
This is a puppet module for installation and configuration of the Selenium
Server 2 browser
automation package. Support is provided for configuring Selenium Server in
standalone
mode along with the grid modes of hub
and node
.
The design intent of this module is to only manage Selenium server and not any of the other packages that might be required to required to create a selenium server profile/role.
Usage
Simple
Stand alone server setup with display :99
(default is :0
).
class { 'selenium::server': display => ':99' }
Grid in a box setup with the Selenium node
talking to the hub
via
127.0.0.1
.
class { 'selenium::hub': }
class { 'selenium::node': }
Example "profiles"/"roles"
Here are some examples "profiles" and "roles" based on Craig Dunn's blog post on Designing Puppet – Roles and Profiles..
These examples assume the presence of these two modules in your Puppet environment.
Selenium Server Profile
class mysite::profile::seleniumserver {
include java
# WSXGA+ 1680x1050 -- should nicely fit on a 1920x1280 screen
class { 'display':
width => 1680,
height => 1050,
} ->
class { 'selenium::server': }
Class['java'] -> Class['selenium::server']
}
Selenium Hub Profile
class mysite::profile::seleniumhub {
include java
class { 'selenium::hub': }
Class['java'] -> Class['selenium::hub']
}
Selenium Node Profile
class mysite::profile::seleniumnode {
include java
# WSXGA+ 1680x1050 -- should nicely fit on a 1920x1280 screen
class { 'display':
width => 1680,
height => 1050,
} ->
class { 'selenium::node':
# If your intending to have node(s) that don't sit on the same system as
# the hub, you need to point the node at a hub by passing in the hub's url
# in or using an exported resource from the hub system. Eg.
# hub => 'http://<myseleniumhub>:4444/grid/register',
}
Class['java'] -> Class['selenium::node']
}
Selenium Server Role
class mysite::role::seleniumserver {
include mysite::profile::seleniumserver
}
Selenium Hub Role
class mysite::role::seleniumhub {
include mysite::profile::seleniumhub
include mysite::profile::seleniumnode
}
Files
Unless class selenium
has $install_root
changed from the default, these
files paths will be used. Note that the log files and init scripts are only
created for the relevant configured service.
The log files will have the mode 0644
so that they can be inspected by users
other than the selenium role account.
/opt/selenium
|-- jars
| `-- selenium-server-standalone-x.xx.x.jar
`-- log
|-- hub_stderr.log
|-- hub_stdout.log
|-- node_stderr.log
|-- node_stdout.log
|-- server_stderr.log
`-- server_stdout.log
/var/log/selenium -> /opt/selenium/log
/etc/init.d/seleniumhub
/etc/init.d/seleniumnode
/etc/init.d/seleniumserver
selenium
This class controls common configuration values used by the
selenium::{server,hub,node}
classes. It is automatically included in the
manifest by those classes and it need not be explicitly declared except to
override the default values.
# defaults
class { 'selenium':
user => 'selenium',
group => 'selenium',
install_root => '/opt/selenium',
java => 'java',
version => '2.39.0',
url => undef,
download_timeout => '90',
}
-
user
String
defaults to:selenium
The name/uid of the system role account to execute the server process under and will have ownership of files.
-
group
String
defaults to:selenium
The group/gid of the system role account and group ownership of files.
-
install_root
String
defaults to:/opt/selenium
The dirname under which Selenium Server files (including logs) will be created.
-
java
String
defaults to:java
The path of the
java
interpreter to use. -
version
String
defaults to:2.39.0
(the latest release as of 2013-12-20)The version of Selenium Server to download. Used to form the URL used to fetch the jar file.
-
url
String
defaults to:undef
If defined,
url
will be used to download the Selenium Server jar file. However, theversion
parameter just match the version of the downloaded file as this information is needed when starting up the server (this may change to be be automatically parsed from theurl
in a later release). -
download_timeout
String
defaults to:90
Timeout to download of the package.
selenium::server
# defaults
class { 'selenium::server':
display => ':0',
options => '-Dwebdriver.enable.native.events=1',
}
-
display
String
defaults to::0
The name of the
X
display to render too. This is set as an environment variable passed to Selenium Server -
options
String
defaults to:-Dwebdriver.enable.native.events=1
Options passed to Selenium Server at startup.
selenium::hub
Note that by default selenium::server
and selenium::hub
will try to listen
on the same TCP port (4444
) and only one of them will be able to function.
# defaults
class { 'selenium::hub':
options => '-role hub',
}
-
options`
String
defaults to:-role hub
Options passed to Selenium Server Hub at startup.
selenium::node
# defaults
class { 'selenium::node':
display => ':0',
options => '-Dwebdriver.enable.native.events=1 -role node',
hub => 'http://localhost:4444/grid/register',
}
-
display
String
defaults to::0
The name of the
X
display to render too. This is set as an environment variable passed to Selenium Server -
options
String
defaults to:-Dwebdriver.enable.native.events=1 -role node
Options passed to Selenium Server Node at startup.
-
hub
String
defaults to:http://localhost:4444/grid/register
The URL of the Selenium Server Hub to connect to.
Why Another Module?
At the time work on this module was started, there were no other Selenium Server modules published on the Puppet Forge. A number of existing modules were identified on github but none of them fit the author's needs of:
- Allowing the external setup of things like
Xvfb
,java
, etc. and to allow the composition of site specific profiles/roles. - Supporting a mixed environment of Scientific, Centos, and RedHat Linux
(basically
$::osfamily == 'RedHat'
- Enough
rspec-puppet
coverage to prevent regressions
The later is the most important issue. Attempting to add additional
$::operatingsystem/$::osfamily
support to a puppet module without
rspec-puppet
tests is a process fraught with peril.
The modules that were identified were:
- adamgoucher/selenium-puppet
- Mostly aimed at Windows but with some Linux/POSIX support
- no
rspec-puppet
tests (deal breaker)
- StoryIQ/puppet-selenium-grid
- Debian only
- no
rspec-puppet
tests (deal breaker)
- kayakco/puppet-selenium
- Unreleased deps (deal breaker)
- Very role like with lots of magic setup (deal breaker)
- debian-ish (may support Centos)
- Doesn't appear to be in a ready state
Limitations
At present, only support for $::osfamily == 'RedHat'
has been implemented.
Adding other Linux distributions will required the addition of platform
specific init scripts.
Tested Platforms
- el6.x
Versioning
This module is versioned according to the Semantic Versioning 2.0.0 specification.
Support
Please log tickets and issues at github
See Also
[Current]
- 8ac1df0 - (Joshua Hoblitt) add validation + rspec of selenium class download_timeout param
- 4c446af - (Joshua Hoblitt) update boilerplate .gitignore
- e881e3e - (Joshua Hoblitt) add selenium class download_timeout param to README
- f46c358 - (Rogério Prado Colferai) Corrected lint erros
- 5d475f2 - (Rogério Prado Colferai) Passing the timeout as parameter for Selenium class
- 7739a50 - (Rogério Prado Colferai) Passing the timeout as parameter for Selenium class
- cdc6f18 - (Joshua Hoblitt) trim travis test matrix
v0.1.6
- cade4b2 - (Joshua Hoblitt) bump version to v0.1.6
- db19171 - (Joshua Hoblitt) update README Files section
- 89cb5d8 - (Joshua Hoblitt) Merge pull request #4 from jhoblitt/system_tests
System tests
- 169cfcd - (Joshua Hoblitt) fix selenium group not being created
As of puppet 3.4.0, the group type will not create/manage a group without
ensure => present
being set.
- 83d4c56 - (Joshua Hoblitt) add basic rspec-system tests
- 9f55770 - (Joshua Hoblitt) Merge pull request #3 from jhoblitt/jar_2.39.0
Jar 2.39.0
- 0b42040 - (Joshua Hoblitt) update default selenium jar version to 2.39.0
- b1afa01 - (Joshua Hoblitt) fix rspec-puppet 1.0.1 deprecation warning
DEPRECATION: include_class is deprecated. Use contain_class instead.
v0.1.5
- 083d2c8 - (Joshua Hoblitt) bump version to v0.1.5
- e01802f - (Joshua Hoblitt) README grammar tweak
- 5635de0 - (Joshua Hoblitt) README typo
- 1eb2f7e - (Joshua Hoblitt) add module deps to see also section of README
- cb9e84d - (Joshua Hoblitt) minor README tweaks
v0.1.4
- b22e8d2 - (Joshua Hoblitt) bump version to v0.1.4
- 469d78a - (Joshua Hoblitt) fix README markdown formatting
- c691874 - (Joshua Hoblitt) add example profiles/roles to README
v0.1.3
- 2a2b481 - (Joshua Hoblitt) bump version to v0.1.3
- 53d8cfe - (Joshua Hoblitt) update default selenium jar file version to 2.37.0 in README
v0.1.2
- bc57dfe - (Joshua Hoblitt) bump version to v0.1.2
- f12845f - (Joshua Hoblitt) update default selenium server version to 2.37.0
v0.1.1
- d9677b1 - (Joshua Hoblitt) bump version to v0.1.1
- 4ca0a1e - (Joshua Hoblitt) Merge pull request #2 from xiankai/refresh_service
Refresh service if the options are changed
- ed4f9d5 - (KJ) Refresh service if the options are changed
- e0476a3 - (Joshua Hoblitt) remove experimental github based puppet forge publishing
- 7e3c232 - (Joshua Hoblitt) enable experimental github based puppet forge publishing
v0.1.0
- 52a25ca - (Joshua Hoblitt) bump version to v0.1.0
- ceacf8f - (Joshua Hoblitt) add a logrotate::rule for $log_path
- 0fc5e6c - (Joshua Hoblitt) remove ruby-head / puppet ~> 3.2.1 & ~> 3.3.0 from travis ci matrix
- ec20f7e - (Joshua Hoblitt) update doc formatting
- ddf0f14 - (Joshua Hoblitt) fix selenium::hub doc examples
v0.0.1
- 3a69948 - (Joshua Hoblitt) fix README ToC anchors
- 37d806b - (Joshua Hoblitt) fix README typos
- 4170146 - (Joshua Hoblitt) doc/README overhaul
- 3be7688 - (Joshua Hoblitt) be consistent about Rakefile quoting style
- 803c0f0 - (Joshua Hoblitt) fix anchor(s)
- cc6075d - (Joshua Hoblitt) reuse the default options from servers on nodes
- eedad0c - (Joshua Hoblitt) whitespace
- a4d77e7 - (Joshua Hoblitt) add class selenium::node
- df6cc77 - (Joshua Hoblitt) add class selenium::hub
- 0904127 - (Joshua Hoblitt) admit defeat and use the anchor pattern in selenium::server
- c96870b - (Joshua Hoblitt) mv service resource into selenium::config to prevent circular deps
- ba59bb7 - (Joshua Hoblitt) merge class selenium::service into selenium::server
- 558c335 - (Joshua Hoblitt) rename selenium::server init.d from seleniumstandalone -> seleniumserver
- 8523e66 - (Joshua Hoblitt) rename class selenium::install -> selenium and refactor it as common base
- 50e63e6 - (Joshua Hoblitt) convert class selenium::config into a define
This is to allow selenium::config to create multiple init.d scripts in the future for selenium hub and grid nodes.
- d742263 - (Joshua Hoblitt) interpolate $prog in init.d script
- 80373a6 - (Joshua Hoblitt) minor rspec cleanups
- 2aeebe7 - (Joshua Hoblitt) cleanup init.d template variable interpolation
- 45e77c2 - (Joshua Hoblitt) add $display param to class selenium::server
Selects the X display to use
- 68d1861 - (Joshua Hoblitt) increase wget timeout 30s -> 90s
To avoid failures seen due to lag spikes
- 9148bbf - (Joshua Hoblitt) fix wget download destination
- 2164d59 - (Joshua Hoblitt) mv user setup from selenium::server -> selenium::install
To break a dependency cycle between wget::fetch and user.
- 93670c4 - (Joshua Hoblitt) fix whitespace
- 45c06af - (Joshua Hoblitt) tie selenium::{install,config,service} together in selenium::server
- e0bc408 - (Joshua Hoblitt) add class selenium::service
- dcf5ebf - (Joshua Hoblitt) add class selenium::config
- 69e8010 - (Joshua Hoblitt) whitespace fix
- 5071e9c - (Joshua Hoblitt) add class selenium::install
- f4f887b - (Joshua Hoblitt) download selenium jars as the selenium user
- b08a9b9 - (Joshua Hoblitt) add selenium::install class with simple download support
- eb724de - (Joshua Hoblitt) stub out selenium::{server,params} classes
- edc5da0 - (Joshua Hoblitt) Merge puppet-module_skel
- 0c59736 - (Joshua Hoblitt) first commit
Dependencies
- puppetlabs/stdlib (>= 3.0.0)
- maestrodev/wget (>= 1.2.2)
- rodjek/logrotate (>= 1.1.1)
Copyright (C) 2012-2013 Joshua Hoblitt <jhoblitt@cpan.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.