Skip to content

Commit

Permalink
msync: test harness
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Apr 5, 2019
1 parent 40e5c6c commit f258cd7
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 75 deletions.
74 changes: 49 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,90 @@ script: ["bundle exec rake validate", "bundle exec rake lint", "bundle exec rake
matrix:
fast_finish: true
include:
- rvm: 2.1.9
- rvm: 2.1
env: PUPPET_GEM_VERSION="~> 4.0"
- rvm: 2.4.1
- rvm: 2.4
env: PUPPET_GEM_VERSION="~> 5.0"
- rvm: 2.5
env: PUPPET_GEM_VERSION="~> 6.0"
- rvm: default
sudo: required
dist: trusty
services: docker
env: BEAKER_set="debian-7"
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=debian7-64{hypervisor=docker}
bundler_args:
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
dist: trusty
services: docker
env: BEAKER_set="debian-8"
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=debian8-64{hypervisor=docker}
bundler_args:
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
dist: trusty
services: docker
env: BEAKER_set="ubuntu-14.04"
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=ubuntu1404-64{hypervisor=docker}
bundler_args:
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
dist: trusty
services: docker
env: BEAKER_set="ubuntu-16.04"
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=ubuntu1604-64{hypervisor=docker}
bundler_args:
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
dist: trusty
services: docker
env: BEAKER_set="centos-6"
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=centos6-64{hypervisor=docker}
bundler_args:
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
dist: trusty
services: docker
env: BEAKER_set="centos-7"
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=centos7-64{hypervisor=docker}
bundler_args:
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb
script: bundle exec rspec spec/acceptance/*_spec.rb
allow_failures:
- rvm: default
sudo: required
dist: trusty
services: docker
env: BEAKER_set="debian-7"
bundler_args:
bundler_args:
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
dist: trusty
services: docker
env: BEAKER_set="ubuntu-16.04"
bundler_args:
bundler_args:
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb
notifications:
email: false
Expand All @@ -86,4 +110,4 @@ deploy:
# all_branches is required to use tags
all_branches: true
# Only publish if our main Ruby target builds
rvm: 2.1.9
rvm: 2.4
50 changes: 25 additions & 25 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"

ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development, :unit_tests do
gem 'rake', :require => false
gem 'rspec', :require => false
gem 'rspec-puppet', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'metadata-json-lint', :require => false
gem 'puppet-lint', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-empty_string-check', :require => false
gem 'puppet-lint-spaceship_operator_without_tag-check', :require => false
gem 'puppet-lint-undef_in_function-check', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'puppet-lint-file_ensure-check', :require => false
gem 'puppet-lint-version_comparison-check', :require => false
gem 'puppet-lint-file_source_rights-check', :require => false
gem 'puppet-lint-alias-check', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'ruby-augeas', :require => false
gem 'puppet-blacksmith', :require => false if RUBY_VERSION !~ /^1\./
gem 'json_pure', '< 2.0.2', :require => false
gem "rake", :require => false
gem "rspec", :require => false
gem "rspec-puppet", :require => false
gem "puppetlabs_spec_helper", :require => false
gem "metadata-json-lint", :require => false
gem "puppet-lint", :require => false
gem "puppet-lint-unquoted_string-check", :require => false
gem "puppet-lint-empty_string-check", :require => false
gem "puppet-lint-spaceship_operator_without_tag-check", :require => false
gem "puppet-lint-undef_in_function-check", :require => false
gem "puppet-lint-leading_zero-check", :require => false
gem "puppet-lint-trailing_comma-check", :require => false
gem "puppet-lint-file_ensure-check", :require => false
gem "puppet-lint-version_comparison-check", :require => false
gem "puppet-lint-file_source_rights-check", :require => false
gem "puppet-lint-alias-check", :require => false
gem "rspec-puppet-facts", :require => false
gem "ruby-augeas", :require => false
gem "puppet-blacksmith", :require => false if RUBY_VERSION !~ /^1\./
gem "json_pure", '< 2.0.2', :require => false
end

group :system_tests do
gem 'beaker', '~>3.13', :require => false
gem 'beaker-rspec', '> 5', :require => false
gem 'beaker_spec_helper', :require => false
gem 'serverspec', :require => false
gem 'specinfra', :require => false
gem "puppet-module-posix-system-r#{minor_version}", :require => false
gem "beaker-hostgenerator", :require => false, :git => 'https://github.com/mcanevet/beaker-hostgenerator.git', :branch => 'fix_debian9'
end

if facterversion = ENV['FACTER_GEM_VERSION']
Expand Down
39 changes: 14 additions & 25 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
require 'beaker-rspec'
require 'beaker-pe'
require 'beaker-puppet'
require 'puppet'
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
require 'beaker/puppet_install_helper'
require 'beaker/module_install_helper'
require 'beaker-task_helper'

install_puppet_agent_on hosts, {}

hosts.each do |host|
if fact('osfamily') == 'RedHat'
install_package host, 'epel-release'
end
end
run_puppet_install_helper
configure_type_defaults_on(hosts)
install_ca_certs unless pe_install?
# install_bolt_on(hosts) unless pe_install?
install_module_on(hosts)
install_module_dependencies_on(hosts)

RSpec.configure do |c|
module_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
module_name = module_root.split('-').last

# Readable test descriptions
c.formatter = :documentation

# Configure all nodes in nodeset
c.before :suite do
# Install module
puppet_module_install(:source => module_root, :module_name => module_name)

hosts.each do |host|
on host, puppet('module','install','puppetlabs-apt'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','puppetlabs-vcsrepo'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','puppetlabs-inifile'), { :acceptable_exit_codes => [0,1] }
end
end
end

0 comments on commit f258cd7

Please sign in to comment.