Skip to content

Commit

Permalink
run acceptance tests also for newer puppet versions (#220)
Browse files Browse the repository at this point in the history
* run acceptance tests also for newer puppet versions

reusing the PUPPET_GEM_VERSION environment variable which is also taken
for rspec-puppet.

* switch from PUPPET_GEM_VERSION to installed puppet version

* remove pry

* smarter handling of installing specific puppet versions
  • Loading branch information
tuxmea authored and alvagante committed Jan 14, 2018
1 parent cb5730c commit 99bcf45
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* Your contribution here.

* [#220](https://github.com/example42/psick/pull/220): Run acceptance tests also for newer puppet versions - [@tuxmea](https://github.com/tuxmea).

## Release 0.9.2 - Second alpha for version 1.0.0
* Updated docs to reflect new separated psick module layout [@alvagante](https://github.com/alvagante)
* Several fixes to data and samples [@alvagante](https://github.com/alvagante)
Expand Down
16 changes: 15 additions & 1 deletion spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
require 'beaker-rspec'
require 'beaker-hiera'
require 'beaker/puppet_install_helper'
begin
require 'puppet'
rescue TypeError
end

hosts.each do |host|
# Install Puppet
install_puppet_agent_on(host)
# check for puppet version
case Puppet.version.to_i
when 4
version_to_install = '1.' + Puppet.version.split('.')[1..-1]*"."
install_puppet_agent_on(host, {:version => version_to_install})
when 5
install_puppet_agent_on(host, {:version => Puppet.version,:puppet_collection => 'puppet5'})
else
puts 'unsupported puppet version'
exit
end
end

RSpec.configure do |c|
Expand Down

0 comments on commit 99bcf45

Please sign in to comment.