Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up acceptance spec helper #403

Merged
merged 1 commit into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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