This plugin integrates Puppeter into Beaker testing harness, by installing and running it with user provided answer files.
Add this line to your module's Gemfile:
gem 'beaker-puppeter', require: false
To use beaker-puppeter add those lines to yours spec/spec_helper_acceptance.rb
file:
require 'beaker/puppeter'
run_puppeter
This configuration will look automatically for Puppeter answers in spec/acceptance/answers/default.yml
, so place it there.
Answer file must be in format accepted by Puppeter. Consult Puppeter documentation for more details.
Sample answer file can be as simple as:
# will install puppet agent 5.x from Puppet Inc. managed deb repositories
installer:
mode: Agent
type: pc5x
You can change answers file in tree ways:
- Using environment variable
PUPPETER_ANSWERS
:
PUPPETER_ANSWERS=puppet4 RS_SET=centos7 bundle exec rake acceptance
- Using directly in code:
run_puppeter 'puppet4' # will run spec/acceptance/answers/puppet4.yml
- Configuring
puppeter_answers
variable in nodeset:
CONFIG:
puppeter_answers: puppet4
The importance of those set methods are: environment variables, direct code, nodeset settings.
You can also utilize run_puppeter_on
helper method to run Puppeter on specific hosts. It's useful when you would like to run different answer files on different hosts.
After checking out the repo, run bundle
to install dependencies. Then, run bundle exec rake spec
to run the unit tests. You can also run bundle exec rake acceptance
to run Docker/Vagrant based acceptance tests.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/coi-gov-pl/beaker-puppeter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the Apache 2.0 License.
Everyone interacting in the Beaker::Puppeter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.