Skip to content

Commit

Permalink
Clean up acceptance spec helper
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl authored and bastelfreak committed Oct 29, 2019
1 parent ba07823 commit 563d4b4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'nodejs class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('os.family')) do
describe 'nodejs class:' do
case fact('os.family')
when 'RedHat'
pkg_cmd = 'yum info nodejs | grep "^From repo"'
Expand Down
28 changes: 16 additions & 12 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@
require 'beaker/module_install_helper'

run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
install_module_on(hosts)
install_module_dependencies_on(hosts)

# Additional modules for soft deps
install_module_from_forge('puppetlabs-apt', '>= 4.4.0 < 8.0.0')
install_module_from_forge('stahnma-epel', '>= 1.2.0 < 2.0.0')
# We do not run Beaker acceptance tests on Windows or Gentoo at the moment.
# install_module_from_forge('puppet-chocolatey', '>= 2.0.0 < 4.0.0')
# install_module_from_forge('gentoo-portage', '>= 2.0.1 < 3.0.0')

UNSUPPORTED_PLATFORMS = %w[AIX Solaris].freeze

RSpec.configure do |c|
# Readable test descriptions
c.formatter = :documentation

# Configure all nodes in nodeset
c.before :suite do
install_module
install_module_dependencies

# Additional modules for soft deps
hosts.each do |host|
case fact_on(host, 'os.family')
when 'Debian'
install_module_from_forge_on(host, 'puppetlabs-apt', '>= 4.4.0 < 8.0.0')
when 'RedHat'
install_module_from_forge_on(host, 'stahnma-epel', '>= 1.2.0 < 2.0.0')
end
end
end
end

shared_examples 'an idempotent resource' do
Expand Down

0 comments on commit 563d4b4

Please sign in to comment.