Skip to content

Commit

Permalink
Support Puppet 5 (#7)
Browse files Browse the repository at this point in the history
* Added Puppet 5 support to the metadata.json
* Updated Tests
  • Loading branch information
Nick Miller authored and trevor-vaughan committed Oct 2, 2017
1 parent 72fccf1 commit 604680c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 53 deletions.
65 changes: 14 additions & 51 deletions .travis.yml
@@ -1,66 +1,29 @@
language: ruby
dist: precise
sudo: required
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
- 2.1.9
# Ruby with Puppet 5
- 2.4.0
notifications:
email:
- raphael.pinson@camptocamp.com
env:
# base env
# Most tests with oldest supported ruby-augeas
- PUPPET=3.0.0 RUBY_AUGEAS=0.3.0 AUGEAS=1.1.0
- PUPPET=3.2.0 RUBY_AUGEAS=0.3.0 AUGEAS=1.1.0
- PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=1.1.0
# Test the latest ruby-augeas (~>)
- PUPPET=3.2.0 RUBY_AUGEAS=0.5
# Use this build to publish on the forge
- PUPPET=3.4 RUBY_AUGEAS=0.5 FORGE_PUBLISH=true
# Test other versions of Augeas
- PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=0.10.0
- PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=1.0.0
- PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=1.1.0
- PUPPET=2.7.0 RUBY_AUGEAS=0.3.0 AUGEAS=1.2.0
- PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=1.2.0
# Issue #83: test old Augeas with new lenses
- PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=1.0.0 LENSES=HEAD
- PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=1.1.0 LENSES=HEAD
- PUPPET=3.4 RUBY_AUGEAS=0.5 AUGEAS=1.0.0 LENSES=HEAD
- PUPPET=3.4 RUBY_AUGEAS=0.5 AUGEAS=1.1.0 LENSES=HEAD
# Test latest Puppet version
# Test Puppet 4
- PUPPET=4.0 RUBY_AUGEAS=0.5

# Test Oldest Puppet, Inc. supported Puppet
- PUPPET=4.7.1 RUBY_AUGEAS=0.5 FORGE_PUBLISH=true
# Test latest Puppet version
- PUPPET=5.0 RUBY_AUGEAS=0.5

matrix:
fast_finish: true
exclude:
# base exclude
# No support for Ruby 2.0 before Puppet 3.2.0 and ruby-augeas 0.5
- rvm: 2.0.0
env: PUPPET=3.0.0 RUBY_AUGEAS=0.3.0
- rvm: 2.0.0
env: PUPPET=3.2.0 RUBY_AUGEAS=0.3.0
- rvm: 2.0.0
env: PUPPET=3.4 RUBY_AUGEAS=0.3.0
- rvm: 2.0.0
env: PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=0.10.0
- rvm: 2.0.0
env: PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=1.0.0
- rvm: 2.0.0
env: PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=1.1.0
- rvm: 2.0.0
env: PUPPET=3.0.0 RUBY_AUGEAS=0.3.0 AUGEAS=1.1.0
- rvm: 2.0.0
env: PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=1.2.0
- rvm: 2.0.0
env: PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=1.0.0 LENSES=HEAD
- rvm: 2.0.0
env: PUPPET=3.4 RUBY_AUGEAS=0.3.0 AUGEAS=1.1.0 LENSES=HEAD
# No support for Ruby 1.8 in Puppet 4
- rvm: 1.8.7
env: PUPPET=4.0 RUBY_AUGEAS=0.5

# base exclude
# No support for Ruby 2.1.9 in Puppet 5
- rvm: 2.1.9
env: PUPPET=5.0 RUBY_AUGEAS=0.5

install:
- "travis_retry ./.travis.sh"
Expand All @@ -78,5 +41,5 @@ deploy:
# all_branches is required to use tags
all_branches: true
# Only publish if our main Ruby target builds
rvm: 1.9.3
rvm: 2.1.9
condition: "$FORGE_PUBLISH = true"
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,11 @@
# Changelog

## 2.1.4

- Upped supported Puppet versions to include Puppet 5

## 2.1.3

- Test and list compatibility with Puppet 4 and latest OSes
- Fix catalog building in spec helper under Puppet 4.6
- Various fixes to test suite and gemset
Expand Down
4 changes: 2 additions & 2 deletions metadata.json
@@ -1,6 +1,6 @@
{
"name": "herculesteam-augeasproviders_core",
"version": "2.1.3",
"version": "2.1.4",
"author": "Dominic Cleal, Raphael Pinson",
"summary": "Alternative Augeas-based providers for Puppet",
"license": "Apache-2.0",
Expand Down Expand Up @@ -45,7 +45,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 2.7.0 < 5.0.0"
"version_requirement": ">= 2.7.0 < 6.0.0"
}
]
}
17 changes: 17 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -23,5 +23,22 @@

Puppet[:modulepath] = File.join(dir, 'fixtures', 'modules')

# There's no real need to make this version dependent, but it helps find
# regressions in Puppet
#
# 1. Workaround for issue #16277 where default settings aren't initialised from
# a spec and so the libdir is never initialised (3.0.x)
# 2. Workaround for 2.7.20 that now only loads types for the current node
# environment (#13858) so Puppet[:modulepath] seems to get ignored
# 3. Workaround for 3.5 where context hasn't been configured yet,
# ticket https://tickets.puppetlabs.com/browse/MODULES-823
#
ver = Gem::Version.new(Puppet.version.split('-').first)
if Gem::Requirement.new("~> 2.7.20") =~ ver || Gem::Requirement.new("~> 3.0.0") =~ ver || Gem::Requirement.new("~> 3.5") =~ ver || Gem::Requirement.new("~> 4.0") =~ ver || Gem::Requirement.new("~> 5.0") =~ ver
puts "augeasproviders: setting Puppet[:libdir] to work around broken type autoloading"
# libdir is only a single dir, so it can only workaround loading of one external module
Puppet[:libdir] = "#{Puppet[:modulepath]}/augeasproviders_core/lib"
end

# Load all shared contexts and shared examples
Dir["#{dir}/support/**/*.rb"].sort.each {|f| require f}

0 comments on commit 604680c

Please sign in to comment.