Skip to content

Commit

Permalink
Merge pull request #345 from ghoneycutt/fix_testing
Browse files Browse the repository at this point in the history
(maint) Fix testing
  • Loading branch information
ghoneycutt authored Dec 8, 2016
2 parents 2bf8a5c + d1f3842 commit 768af7f
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 40 deletions.
8 changes: 4 additions & 4 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
fixtures:
repositories:
'stdlib':
repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
stdlib:
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '4.6.0'
'epel':
repo: 'git://github.com/stahnma/puppet-module-epel.git'
epel:
repo: 'https://github.com/stahnma/puppet-module-epel.git'
ref: '1.2.2'
symlinks:
python: "#{source_dir}"
25 changes: 20 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ language: ruby

bundler_args: --without system_tests

before_install:
- bundle -v
- rm Gemfile.lock || true
- gem update --system
- gem update bundler
- gem --version
- bundle -v

rvm:
- 1.8.7
- 1.9.3
Expand All @@ -27,16 +35,17 @@ env:
- PUPPET_GEM_VERSION="~> 4.3.0"
- PUPPET_GEM_VERSION="~> 4.4.0"
- PUPPET_GEM_VERSION="~> 4.5.0"
- PUPPET_GEM_VERSION="~> 4" STRICT_VARIABLES="yes"
- PUPPET_GEM_VERSION="~> 4.6.0"
- PUPPET_GEM_VERSION="~> 4.7.0"
- PUPPET_GEM_VERSION="~> 4.8.0"
- PUPPET_GEM_VERSION="~> 4"

sudo: false

script: 'bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec'
script: 'SPEC_OPTS="--format documentation" bundle exec rake validate lint spec'

matrix:
fast_finish: true
allow_failures:
- rvm: 2.3.1
exclude:
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.1.0"
Expand All @@ -61,7 +70,13 @@ matrix:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4.5.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4" STRICT_VARIABLES="yes"
env: PUPPET_GEM_VERSION="~> 4.6.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4.7.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4.8.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4"
- rvm: 2.3.1
env: PUPPET_GEM_VERSION="~> 3.1.0"
- rvm: 2.3.1
Expand Down
48 changes: 17 additions & 31 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"

group :development, :test do
gem 'metadata-json-lint', :require => false
gem 'rspec-puppet', :require => false
gem 'puppetlabs_spec_helper', '1.1.1'
gem 'puppet-lint', :require => false
gem 'pry', :require => false
gem 'simplecov', :require => false
end

# pin old versions for ruby 1.8.7
if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '1.9'
gem 'rspec', '~> 2.0'
gem 'rake', '~> 10.0'
else
gem 'rake', :require => false
group :system_tests do
gem 'serverspec', :require => false
gem 'beaker', :require => false
gem 'beaker-rspec', :require => false
end

if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '2.0'
# json 2.x requires ruby 2.0. Lock to 1.8
gem 'json', '~> 1.8'
# json_pure 2.0.2 requires ruby 2.0. Lock to 2.0.1
gem 'json_pure', '= 2.0.1'
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'json'
gem 'puppet', :require => false
end

if facterversion = ENV['FACTER_GEM_VERSION']
Expand All @@ -32,16 +18,16 @@ else
gem 'facter', :require => false
end

if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end
gem 'puppetlabs_spec_helper', '>= 1.2.0', :require => false
gem 'rspec-puppet', :require => false
gem 'puppet-lint', '~> 2.0', :require => false
gem 'simplecov', :require => false

group :system_tests do
gem 'serverspec', :require => false
gem 'beaker', :require => false
gem 'beaker-rspec', :require => false
end
gem 'rspec', '~> 2.0', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
gem 'rake', '~> 10.0', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
gem 'json', '<= 1.8', :require => false if RUBY_VERSION < '2.0.0'
gem 'json_pure', '<= 2.0.1', :require => false if RUBY_VERSION < '2.0.0'
gem 'metadata-json-lint', '0.0.11', :require => false if RUBY_VERSION < '1.9'
gem 'metadata-json-lint', :require => false if RUBY_VERSION >= '1.9'

# vim:ft=ruby
17 changes: 17 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
require 'puppetlabs_spec_helper/module_spec_helper'

RSpec.configure do |config|
config.hiera_config = 'spec/fixtures/hiera/hiera.yaml'
config.before :each do
# Ensure that we don't accidentally cache facts and environment between
# test cases. This requires each example group to explicitly load the
# facts being exercised with something like
# Facter.collection.loader.load(:ipaddress)
Facter.clear
Facter.clear_messages
end
config.default_facts = {
:environment => 'rp_env',
:operatingsystemmajrelease => '6',
:osfamily => 'RedHat',
}
end

0 comments on commit 768af7f

Please sign in to comment.