Skip to content

Commit

Permalink
modulesync: speed improvements, puppet-blacksmith 1.8.7 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Cleal committed Dec 1, 2015
1 parent 88d1898 commit 1f4235d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 19 deletions.
28 changes: 16 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ env:
- PUPPET_VERSION=4.0 ONLY_OS=centos-7-x86_64,ubuntu-14-x86_64
- PUPPET_VERSION=3.5 ONLY_OS=centos-7-x86_64,ubuntu-14-x86_64 FUTURE_PARSER=yes TRUSTED_NODE_DATA=yes
- PUPPET_VERSION=3.5 ONLY_OS=centos-7-x86_64,ubuntu-14-x86_64
# Test FreeBSD explicitly so we can exclude ruby 1.8.7 tests
- PUPPET_VERSION=4.0 ONLY_OS=freebsd-9-amd64,freebsd-10-amd64
- PUPPET_VERSION=3.5 ONLY_OS=freebsd-9-amd64,freebsd-10-amd64 FUTURE_PARSER=yes TRUSTED_NODE_DATA=yes
- PUPPET_VERSION=3.5 ONLY_OS=freebsd-9-amd64,freebsd-10-amd64
# Test operating systems with ruby 1.8.7 explicitly so we can exclude ruby 1.8.7 tests for other OS
- PUPPET_VERSION=4.0 ONLY_OS=ubuntu-12-x86_64,redhat-6-x86_64,scientific-6-x86_64,centos-6-x86_64,debian-6-x86_64
- PUPPET_VERSION=3.5 ONLY_OS=ubuntu-12-x86_64,redhat-6-x86_64,scientific-6-x86_64,centos-6-x86_64,debian-6-x86_64 FUTURE_PARSER=yes TRUSTED_NODE_DATA=yes
- PUPPET_VERSION=3.5 ONLY_OS=ubuntu-12-x86_64,redhat-6-x86_64,scientific-6-x86_64,centos-6-x86_64,debian-6-x86_64
# Test the rest of the supported platforms
- PUPPET_VERSION=4.0 EXCLUDE_OS=centos-7-x86_64,ubuntu-14-x86_64,freebsd-9-amd64,freebsd-10-amd64
- PUPPET_VERSION=3.5 EXCLUDE_OS=centos-7-x86_64,ubuntu-14-x86_64,freebsd-9-amd64,freebsd-10-amd64 FUTURE_PARSER=yes TRUSTED_NODE_DATA=yes
- PUPPET_VERSION=3.5 EXCLUDE_OS=centos-7-x86_64,ubuntu-14-x86_64,freebsd-9-amd64,freebsd-10-amd64
- PUPPET_VERSION=4.0 EXCLUDE_OS=centos-7-x86_64,ubuntu-14-x86_64,ubuntu-12-x86_64,redhat-6-x86_64,scientific-6-x86_64,centos-6-x86_64,debian-6-x86_64
- PUPPET_VERSION=3.5 EXCLUDE_OS=centos-7-x86_64,ubuntu-14-x86_64,ubuntu-12-x86_64,redhat-6-x86_64,scientific-6-x86_64,centos-6-x86_64,debian-6-x86_64 FUTURE_PARSER=yes TRUSTED_NODE_DATA=yes
- PUPPET_VERSION=3.5 EXCLUDE_OS=centos-7-x86_64,ubuntu-14-x86_64,ubuntu-12-x86_64,redhat-6-x86_64,scientific-6-x86_64,centos-6-x86_64,debian-6-x86_64
# Only test Puppet 2.7 on ubuntu 12 and centos 6
- PUPPET_VERSION=2.7.0 ONLY_OS=ubuntu-12-x86_64,centos-6-x86_64
matrix:
Expand All @@ -37,13 +37,17 @@ matrix:
- rvm: 1.8.7
env: PUPPET_VERSION=4.0 ONLY_OS=centos-7-x86_64,ubuntu-14-x86_64
- rvm: 1.8.7
env: PUPPET_VERSION=4.0 EXCLUDE_OS=centos-7-x86_64,ubuntu-14-x86_64,freebsd-9-amd64,freebsd-10-amd64
env: PUPPET_VERSION=4.0 ONLY_OS=ubuntu-12-x86_64,redhat-6-x86_64,scientific-6-x86_64,centos-6-x86_64,debian-6-x86_64
- rvm: 1.8.7
env: PUPPET_VERSION=4.0 ONLY_OS=freebsd-9-amd64,freebsd-10-amd64
# Exclude FreeBSD tests on Ruby 1.8.7
env: PUPPET_VERSION=4.0 EXCLUDE_OS=centos-7-x86_64,ubuntu-14-x86_64,ubuntu-12-x86_64,redhat-6-x86_64,scientific-6-x86_64,centos-6-x86_64,debian-6-x86_64
# Exclude tests on OS that do not ship with Ruby 1.8.7
- rvm: 1.8.7
env: PUPPET_VERSION=3.5 ONLY_OS=freebsd-9-amd64,freebsd-10-amd64 FUTURE_PARSER=yes TRUSTED_NODE_DATA=yes
env: PUPPET_VERSION=3.5 ONLY_OS=centos-7-x86_64,ubuntu-14-x86_64
- rvm: 1.8.7
env: PUPPET_VERSION=3.5 ONLY_OS=freebsd-9-amd64,freebsd-10-amd64
env: PUPPET_VERSION=3.5 ONLY_OS=centos-7-x86_64,ubuntu-14-x86_64 FUTURE_PARSER=yes TRUSTED_NODE_DATA=yes
- rvm: 1.8.7
env: PUPPET_VERSION=3.5 EXCLUDE_OS=centos-7-x86_64,ubuntu-14-x86_64,ubuntu-12-x86_64,redhat-6-x86_64,scientific-6-x86_64,centos-6-x86_64,debian-6-x86_64
- rvm: 1.8.7
env: PUPPET_VERSION=3.5 EXCLUDE_OS=centos-7-x86_64,ubuntu-14-x86_64,ubuntu-12-x86_64,redhat-6-x86_64,scientific-6-x86_64,centos-6-x86_64,debian-6-x86_64 FUTURE_PARSER=yes TRUSTED_NODE_DATA=yes
bundler_args: --without development
sudo: false
15 changes: 9 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'

# blacksmith isn't always present, e.g. on Travis with --without development
begin
require 'puppet_blacksmith/rake_tasks'
Blacksmith::RakeTask.new do |t|
t.tag_pattern = "%s"
# blacksmith is broken with ruby 1.8.7
if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.8.7')
# blacksmith isn't always present, e.g. on Travis with --without development
begin
require 'puppet_blacksmith/rake_tasks'
Blacksmith::RakeTask.new do |t|
t.tag_pattern = "%s"
end
rescue LoadError
end
rescue LoadError
end

PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"]
Expand Down
9 changes: 8 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def verify_concat_fragment_exact_contents(subject, title, expected_lines)
expect(content.split(/\n/).reject { |line| line =~ /(^#|^$|^\s+#)/ }).to eq(expected_lines)
end

# See https://github.com/rodjek/rspec-puppet/issues/215
# See https://github.com/rodjek/rspec-puppet/issues/329
# Without this patch the @@cache variable grows huge and causes memory usage issues
# with a large amount of examples.
module RSpec::Puppet
Expand All @@ -63,3 +63,10 @@ def build_catalog(*args)
end
end
end

# See https://github.com/rodjek/rspec-puppet/pull/333
# Prevents each generated catalog being held in memory after the example group has
# completed.
RSpec.configure do |c|
c.after(:each) { @catalogue = nil }
end

0 comments on commit 1f4235d

Please sign in to comment.