Skip to content

Commit

Permalink
fix installing module dependencies in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deric committed Feb 27, 2020
1 parent 484cff3 commit 64a4509
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"

group :test do
gem "puppet", ENV['PUPPET_VERSION'] || ['> 3.3.0','< 6.0']
gem "puppet", ENV['PUPPET_VERSION'] || ['> 4.10.0','< 7.0']
gem "rspec"
gem 'rspec-puppet'
gem "puppetlabs_spec_helper"
Expand All @@ -28,6 +28,7 @@ group :development do
gem "travis-lint"
gem 'puppet-blacksmith', git: 'https://github.com/deric/puppet-blacksmith', branch: 'tag-order'
gem "guard-rake"
gem 'pdk', '> 1.0'
end

group :system_tests do
Expand All @@ -38,5 +39,6 @@ group :system_tests do
gem 'serverspec'
gem 'beaker-hostgenerator'
gem 'beaker-puppet_install_helper'
gem 'beaker-module_install_helper'
gem 'master_manipulator'
end
5 changes: 4 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
{
"name": "puppetlabs-stdlib",
"version_requirement": ">= 4.6.0 < 7.0.0"
},
{ "name": "puppetlabs-augeas_core",
"version_requirement": "> 1.0.0"
}
],
"operatingsystem_support": [
Expand Down Expand Up @@ -53,7 +56,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.0.0 < 7.0.0"
"version_requirement": ">= 4.10.0 < 7.0.0"
}
]
}
13 changes: 7 additions & 6 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
require 'beaker/puppet_install_helper'
require 'beaker/module_install_helper'

UNSUPPORTED_PLATFORMS = ['windows','AIX','Solaris'].freeze

Expand All @@ -16,15 +17,12 @@

# Configure all nodes in nodeset
c.before :suite do
#install_puppet
# Install modules and dependencies from spec/fixtures/modules

hosts.each do |host|
if ['RedHat'].include?(fact('osfamily'))
on host, 'yum install -y tar'
end
#on host, 'gem install bundler'
#on host, 'cd /etc/puppet && bundle install --without development'
on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
# on host, puppet('module', 'install', 'deric-gpasswd'), { :acceptable_exit_codes => [0,1] }
#binding.pry
on host, "mkdir -p /etc/puppetlabs/puppet /etc/puppet/modules", { :acceptable_exit_codes => [0] }
on host, "mkdir -p #{HIERA_PATH}", { :acceptable_exit_codes => [0] }
Expand All @@ -35,8 +33,11 @@
scp_to host, File.expand_path('./spec/acceptance/hieradata'), HIERA_PATH
# assume puppet is on $PATH
on host, "puppet --version"

install_module_dependencies
install_module_on(host)

on host, "puppet module list"
end
puppet_module_install(:source => proj_root, :module_name => 'accounts')
end
end

0 comments on commit 64a4509

Please sign in to comment.