Skip to content

Commit 768af7f

Browse files
authored
Merge pull request voxpupuli#345 from ghoneycutt/fix_testing
(maint) Fix testing
2 parents 2bf8a5c + d1f3842 commit 768af7f

4 files changed

Lines changed: 58 additions & 40 deletions

File tree

.fixtures.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
fixtures:
22
repositories:
3-
'stdlib':
4-
repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
3+
stdlib:
4+
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
55
ref: '4.6.0'
6-
'epel':
7-
repo: 'git://github.com/stahnma/puppet-module-epel.git'
6+
epel:
7+
repo: 'https://github.com/stahnma/puppet-module-epel.git'
88
ref: '1.2.2'
99
symlinks:
1010
python: "#{source_dir}"

.travis.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ language: ruby
33

44
bundler_args: --without system_tests
55

6+
before_install:
7+
- bundle -v
8+
- rm Gemfile.lock || true
9+
- gem update --system
10+
- gem update bundler
11+
- gem --version
12+
- bundle -v
13+
614
rvm:
715
- 1.8.7
816
- 1.9.3
@@ -27,16 +35,17 @@ env:
2735
- PUPPET_GEM_VERSION="~> 4.3.0"
2836
- PUPPET_GEM_VERSION="~> 4.4.0"
2937
- PUPPET_GEM_VERSION="~> 4.5.0"
30-
- PUPPET_GEM_VERSION="~> 4" STRICT_VARIABLES="yes"
38+
- PUPPET_GEM_VERSION="~> 4.6.0"
39+
- PUPPET_GEM_VERSION="~> 4.7.0"
40+
- PUPPET_GEM_VERSION="~> 4.8.0"
41+
- PUPPET_GEM_VERSION="~> 4"
3142

3243
sudo: false
3344

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

3647
matrix:
3748
fast_finish: true
38-
allow_failures:
39-
- rvm: 2.3.1
4049
exclude:
4150
- rvm: 2.0.0
4251
env: PUPPET_GEM_VERSION="~> 3.1.0"
@@ -61,7 +70,13 @@ matrix:
6170
- rvm: 1.8.7
6271
env: PUPPET_GEM_VERSION="~> 4.5.0"
6372
- rvm: 1.8.7
64-
env: PUPPET_GEM_VERSION="~> 4" STRICT_VARIABLES="yes"
73+
env: PUPPET_GEM_VERSION="~> 4.6.0"
74+
- rvm: 1.8.7
75+
env: PUPPET_GEM_VERSION="~> 4.7.0"
76+
- rvm: 1.8.7
77+
env: PUPPET_GEM_VERSION="~> 4.8.0"
78+
- rvm: 1.8.7
79+
env: PUPPET_GEM_VERSION="~> 4"
6580
- rvm: 2.3.1
6681
env: PUPPET_GEM_VERSION="~> 3.1.0"
6782
- rvm: 2.3.1

Gemfile

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,15 @@
11
source ENV['GEM_SOURCE'] || "https://rubygems.org"
22

3-
group :development, :test do
4-
gem 'metadata-json-lint', :require => false
5-
gem 'rspec-puppet', :require => false
6-
gem 'puppetlabs_spec_helper', '1.1.1'
7-
gem 'puppet-lint', :require => false
8-
gem 'pry', :require => false
9-
gem 'simplecov', :require => false
10-
end
11-
12-
# pin old versions for ruby 1.8.7
13-
if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '1.9'
14-
gem 'rspec', '~> 2.0'
15-
gem 'rake', '~> 10.0'
16-
else
17-
gem 'rake', :require => false
3+
group :system_tests do
4+
gem 'serverspec', :require => false
5+
gem 'beaker', :require => false
6+
gem 'beaker-rspec', :require => false
187
end
198

20-
if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '2.0'
21-
# json 2.x requires ruby 2.0. Lock to 1.8
22-
gem 'json', '~> 1.8'
23-
# json_pure 2.0.2 requires ruby 2.0. Lock to 2.0.1
24-
gem 'json_pure', '= 2.0.1'
9+
if puppetversion = ENV['PUPPET_GEM_VERSION']
10+
gem 'puppet', puppetversion, :require => false
2511
else
26-
gem 'json'
12+
gem 'puppet', :require => false
2713
end
2814

2915
if facterversion = ENV['FACTER_GEM_VERSION']
@@ -32,16 +18,16 @@ else
3218
gem 'facter', :require => false
3319
end
3420

35-
if puppetversion = ENV['PUPPET_GEM_VERSION']
36-
gem 'puppet', puppetversion, :require => false
37-
else
38-
gem 'puppet', :require => false
39-
end
21+
gem 'puppetlabs_spec_helper', '>= 1.2.0', :require => false
22+
gem 'rspec-puppet', :require => false
23+
gem 'puppet-lint', '~> 2.0', :require => false
24+
gem 'simplecov', :require => false
4025

41-
group :system_tests do
42-
gem 'serverspec', :require => false
43-
gem 'beaker', :require => false
44-
gem 'beaker-rspec', :require => false
45-
end
26+
gem 'rspec', '~> 2.0', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
27+
gem 'rake', '~> 10.0', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
28+
gem 'json', '<= 1.8', :require => false if RUBY_VERSION < '2.0.0'
29+
gem 'json_pure', '<= 2.0.1', :require => false if RUBY_VERSION < '2.0.0'
30+
gem 'metadata-json-lint', '0.0.11', :require => false if RUBY_VERSION < '1.9'
31+
gem 'metadata-json-lint', :require => false if RUBY_VERSION >= '1.9'
4632

4733
# vim:ft=ruby

spec/spec_helper.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
11
require 'puppetlabs_spec_helper/module_spec_helper'
2+
3+
RSpec.configure do |config|
4+
config.hiera_config = 'spec/fixtures/hiera/hiera.yaml'
5+
config.before :each do
6+
# Ensure that we don't accidentally cache facts and environment between
7+
# test cases. This requires each example group to explicitly load the
8+
# facts being exercised with something like
9+
# Facter.collection.loader.load(:ipaddress)
10+
Facter.clear
11+
Facter.clear_messages
12+
end
13+
config.default_facts = {
14+
:environment => 'rp_env',
15+
:operatingsystemmajrelease => '6',
16+
:osfamily => 'RedHat',
17+
}
18+
end

0 commit comments

Comments
 (0)